import subprocess
-from subprocess import CalledProcessError, PIPE, STDOUT
import sys
+class CalledProcessError(subprocess.CalledProcessError):
+ pass
+
class Shell(object):
"""An advanced shell, with the ability to do dry-run and log commands"""
def __init__(self, logger = False, dry = False):
# output from Git work
proc = subprocess.Popen(args, stdout=sys.stdout, stderr=sys.stderr)
else:
- proc = subprocess.Popen(args, stdout=PIPE, stderr=STDOUT)
+ proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
else:
proc = subprocess.Popen(args)
stdout, _ = proc.communicate()