From 44726ecdea735e1405960ac5f36d0b7af3de4e04 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Thu, 4 Mar 2010 16:01:12 +0100 Subject: [PATCH] Port to Python 2.4: replace subprocess.check_call(). --- patoolib/util.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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