Skip to content

Commit

Permalink
better handle called process error
Browse files Browse the repository at this point in the history
  • Loading branch information
dschep committed Sep 8, 2018
1 parent 87b261f commit 0570a41
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ntfy/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
def linux_window_is_focused():
xprop_cmd = shlex.split('xprop -root _NET_ACTIVE_WINDOW')
try:
xprop_window_id = int(check_output(xprop_cmd).split()[-1], 16)
except (ValueError, CalledProcessError):
xprop_window_id = int(check_output(xprop_cmd, stdout=PIPE, stderr=PIPE).split()[-1], 16)
except CalledProcessError:
return False
except ValueError:
return False
except OSError as e:
if 'No such file' in e.strerror:
Expand Down

0 comments on commit 0570a41

Please sign in to comment.