From 5fe752cf7223cc9ff1cf1a50ad5f7873594f83c1 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Mon, 6 Sep 2021 13:22:53 +0000 Subject: No need for try/catch any longer. The old behavior of SysCommand was that exit codes raised an exception, which needed to be handled by each individual caller. We now utilize `.exit_code` instead to manually detect faulty commands and raise exceptions where needed. --- archinstall/lib/hardware.py | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'archinstall/lib/hardware.py') diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py index d040c19a..f38d46da 100644 --- a/archinstall/lib/hardware.py +++ b/archinstall/lib/hardware.py @@ -149,16 +149,5 @@ def virtualization() -> Optional[str]: def is_vm() -> bool: return b"none" not in b"".join(SysCommand("systemd-detect-virt")).lower() - """ - try: - # systemd-detect-virt issues a non-zero exit code if it is not on a virtual machine - if b"none" not in b"".join(SysCommand("systemd-detect-virt")).lower(): - return True - except: - pass - - return False - - """ # TODO: Add more identifiers -- cgit v1.2.3-54-g00ecf