Merge pull request #546 from mattrose/issue-539
don't traceback while searching through /proc
This commit is contained in:
commit
4ab3343e61
11
terminator
11
terminator
|
@ -58,8 +58,15 @@ if __name__ == '__main__':
|
||||||
# Environment also needs IBUS_DISABLE_SNOOPER=1, or double chars appear
|
# Environment also needs IBUS_DISABLE_SNOOPER=1, or double chars appear
|
||||||
# in the receivers.
|
# in the receivers.
|
||||||
username = pwd.getpwuid(os.getuid()).pw_name
|
username = pwd.getpwuid(os.getuid()).pw_name
|
||||||
ibus_running = [p for p in psutil.process_iter() if p.name() == 'ibus-daemon' and p.username() == username]
|
ibus_running = False
|
||||||
ibus_running = len(ibus_running) > 0
|
for proc in psutil.process_iter():
|
||||||
|
try:
|
||||||
|
if proc.name() == 'ibus-daemon' and proc.username() == username:
|
||||||
|
ibus_running = True
|
||||||
|
break
|
||||||
|
except (psutil.AccessDenied) as err:
|
||||||
|
print("error getting details while looking for Ibus process: %s" % err)
|
||||||
|
|
||||||
if ibus_running:
|
if ibus_running:
|
||||||
os.environ['IBUS_DISABLE_SNOOPER']='1'
|
os.environ['IBUS_DISABLE_SNOOPER']='1'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue