]> scripts.mit.edu Git - wizard.git/blobdiff - lib/wizard/shell.py
More reorganization; make massmigrate catch all Wizard errors.
[wizard.git] / lib / wizard / shell.py
index a65a250abe6a566e54a364b7c6301cf8950617f4..3484163f2001b3359ee191ee31ff70cb76620beb 100644 (file)
@@ -1,7 +1,9 @@
 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):
@@ -20,7 +22,7 @@ class Shell(object):
                 # 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()