diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py index 163f76118..e2277d54a 100644 --- a/psutil/tests/__init__.py +++ b/psutil/tests/__init__.py @@ -129,8 +129,7 @@ CI_TESTING = APPVEYOR or GITHUB_ACTIONS COVERAGE = 'COVERAGE_RUN' in os.environ if LINUX: - with open('/proc/self/cmdline') as f: - QEMU_USER = "/bin/qemu-" in f.read() + QEMU_USER = "/bin/qemu-" in psutil.Process().cmdline()[0] else: QEMU_USER = False # are we a 64 bit process?