Changeset 42
- Timestamp:
- 06/07/06 18:03:15 (7 years ago)
- Files:
-
- branches/mk/cheesecake/_util.py (modified) (2 diffs)
- branches/mk/cheesecake/subprocess.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/mk/cheesecake/_util.py
r40 r42 19 19 20 20 import os, sys 21 from subprocess import call, P open, PIPE, STDOUT21 from subprocess import call, ProcessError, Popen, PIPE, STDOUT 22 22 23 23 PAD_TEXT = 40 … … 29 29 """ 30 30 arglist = cmd.split() 31 p = Popen(arglist, stdout=PIPE, stderr=STDOUT) 31 try: 32 p = Popen(arglist, stdout=PIPE, stderr=STDOUT) 33 except ProcessError, e: 34 return 1, e 32 35 output = p.communicate()[0] 33 36 return p.returncode, output branches/mk/cheesecake/subprocess.py
r10 r42 394 394 import pickle 395 395 396 __all__ = ["Popen", "PIPE", "STDOUT", "call" ]396 __all__ = ["Popen", "PIPE", "STDOUT", "call", "ProcessError"] 397 397 398 398 try: … … 495 495 return ''.join(result) 496 496 497 class ProcessError(Exception): 498 """This exception is raised when there is an error calling 499 a subprocess.""" 500 pass 497 501 498 502 class Popen(object): … … 984 988 if data != "": 985 989 child_exception = pickle.loads(data) 986 raise child_exception990 raise ProcessError, child_exception 987 991 988 992
