diff --git a/monitor.py b/monitor.py index d0a79716f..ce6b60759 100644 --- a/monitor.py +++ b/monitor.py @@ -2156,12 +2156,11 @@ def game_running(self) -> bool: # Process likely expired self.running_process = None if not self.running_process: - edmc_process = psutil.Process() - edmc_user = edmc_process.username() try: - for pid in psutil.pids(): - proc = psutil.Process(pid) - if 'EliteDangerous' in proc.name() and proc.username() == edmc_user: + edmc_process = psutil.Process() + edmc_user = edmc_process.username() + for proc in psutil.process_iter(['name', 'username']): + if 'EliteDangerous' in proc.info['name'] and proc.info['username'] == edmc_user: self.running_process = proc return True except psutil.NoSuchProcess: diff --git a/requirements.txt b/requirements.txt index 23e90a95d..7aac47d10 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,4 +5,4 @@ simplesystray==0.1.0; sys_platform == 'win32' semantic-version==2.10.0 # For manipulating folder permissions and the like. pywin32==306; sys_platform == 'win32' -psutil==5.9.8 +psutil==6.0.0