Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions pyscreeze/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,23 @@
GNOMESCREENSHOT_EXISTS = False
try:
if sys.platform.startswith('linux'):
whichProc = subprocess.Popen(['which', 'gnome-screenshot'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
whichProc = subprocess.Popen(['gnome-screenshot', '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
GNOMESCREENSHOT_EXISTS = whichProc.wait() == 0
except OSError as ex:
if ex.errno == errno.ENOENT:
# if there is no "which" program to find gnome-screenshot, then assume there
# is no gnome-screenshot.
# no entry for gnome-screenshot
pass
else:
raise

SCROT_EXISTS = False
try:
if sys.platform.startswith('linux'):
whichProc = subprocess.Popen(['which', 'scrot'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
whichProc = subprocess.Popen(['scrot', '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
SCROT_EXISTS = whichProc.wait() == 0
except OSError as ex:
if ex.errno == errno.ENOENT:
# if there is no "which" program to find scrot, then assume there
# is no scrot.
# no entry for scrot
pass
else:
raise
Expand Down