Port to Python 2.4: replace subprocess.check_call().

This commit is contained in:
Bastian Kleineidam 2010-03-04 16:01:12 +01:00
parent 778c1e366b
commit 44726ecdea
1 changed files with 6 additions and 2 deletions

View File

@ -76,8 +76,12 @@ def backtick (cmd):
def run (cmd, **kwargs):
"""Run command and raise subprocess.CalledProcessError on error."""
subprocess.check_call(cmd, **kwargs)
"""Run command and raise PatoolError on error."""
retcode = subprocess.call(cmd, **kwargs)
if retcode:
msg = "Command `%s' returned non-zero exit status %d" % (cmd, retcode)
raise PatoolError(msg)
return retcode
@memoized