Bug 1560162 - Handle psutil exception in 'mach android-emulator'; r=denschub

I haven't reproduced this failure myself, but this change *should* help.

Differential Revision: https://phabricator.services.mozilla.com/D35561

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Geoff Brown 2019-06-21 20:07:20 +00:00
Родитель 6b007e9918
Коммит 46ae70c525
1 изменённых файлов: 8 добавлений и 5 удалений

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

@ -423,11 +423,14 @@ class AndroidEmulator(object):
Returns True if the Android emulator is running.
"""
for proc in psutil.process_iter():
name = proc.name()
# On some platforms, "emulator" may start an emulator with
# process name "emulator64-arm" or similar.
if name and name.startswith('emulator'):
return True
try:
name = proc.name()
# On some platforms, "emulator" may start an emulator with
# process name "emulator64-arm" or similar.
if name and name.startswith('emulator'):
return True
except Exception as e:
_log_debug("failed to get process name: %s" % str(e))
return False
def is_available(self):