Bug 1776219 - Gracefully handle psutils failures in mach telemetry. r=firefox-build-system-reviewers,ahochheiden

On OpenBSD/i386, psutils fails in the generator used to enumerate the
active processes, breaking the build.

Differential Revision: https://phabricator.services.mozilla.com/D150462
This commit is contained in:
Alessio Placitelli 2022-06-29 09:03:28 +00:00
Родитель a0e2dc5103
Коммит 9fa5e395be
1 изменённых файлов: 18 добавлений и 19 удалений

Просмотреть файл

@ -242,11 +242,6 @@ def get_vscode_running():
"""Return if the vscode is currently running."""
try:
import psutil
except Exception:
psutil = None
if not psutil:
return None
for proc in psutil.process_iter():
try:
@ -262,5 +257,9 @@ def get_vscode_running():
except Exception:
# may not be able to access process info for all processes
continue
except Exception:
# On some platforms, sometimes, the generator throws an
# exception preventing us to enumerate.
return False
return False