fix nhang_notify_helper crash

This commit is contained in:
Alexey Avramov 2019-03-04 14:25:55 +09:00
parent 0e1bed33e7
commit 5f542d9272

View File

@ -57,12 +57,21 @@ def re_pid_environ(pid):
if i.startswith('HOME=/var'): if i.startswith('HOME=/var'):
return None return None
try:
# dirty hack; todo: fix alg
env = user.partition('USER=')[2], display, dbus env = user.partition('USER=')[2], display, dbus
except UnboundLocalError:
print('notify helper: UnboundLocalError')
return None
return env return env
except FileNotFoundError: except FileNotFoundError:
print('notify helper: FileNotFoundError')
return None return None
except ProcessLookupError: except ProcessLookupError:
print('notify helper: ProcessLookupError')
return None return None