Skip to content

Instantly share code, notes, and snippets.

@skull-squadron
Created August 26, 2011 07:21
Show Gist options
  • Save skull-squadron/1172895 to your computer and use it in GitHub Desktop.
Save skull-squadron/1172895 to your computer and use it in GitHub Desktop.
Better subprocess.call
import subprocess
def better_call(args, check=False):
try:
if check:
return subprocess.check_call(args)
else:
return subprocess.call(args)
except:
# Fix: Ctrl-C while reading a password (stty -echo) doesn't restore stty echo.
subprocess.call('stty echo', shell=True)
raise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment