diff --git a/patoolib/util.py b/patoolib/util.py index e4b6062..cd7345d 100644 --- a/patoolib/util.py +++ b/patoolib/util.py @@ -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