From 5f542d9272e0b83dc6269cdfc126b5d26f44311a Mon Sep 17 00:00:00 2001 From: Alexey Avramov Date: Mon, 4 Mar 2019 14:25:55 +0900 Subject: [PATCH] fix nhang_notify_helper crash --- nohang_notify_helper | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nohang_notify_helper b/nohang_notify_helper index 1bdd311..06e9d95 100755 --- a/nohang_notify_helper +++ b/nohang_notify_helper @@ -57,12 +57,21 @@ def re_pid_environ(pid): if i.startswith('HOME=/var'): return None - env = user.partition('USER=')[2], display, dbus + + try: + # dirty hack; todo: fix alg + env = user.partition('USER=')[2], display, dbus + except UnboundLocalError: + print('notify helper: UnboundLocalError') + return None + return env except FileNotFoundError: + print('notify helper: FileNotFoundError') return None except ProcessLookupError: + print('notify helper: ProcessLookupError') return None