rhelmer%mozilla.com 3780df7cac botrunner - buildbot auto-install and update configs from CVS b=378529 r=rhelmer r=preed p=bhearsum p=rhelmer
git-svn-id: svn://10.0.0.236/trunk@227544 18797224-902f-48f8-a5cc-f745e15eee43
2007-06-05 19:57:39 +00:00

16 lines
627 B
Python

def check_call(*popenargs, **kwargs):
try:
from subprocess import check_call
check_call(*popenargs, **kwargs)
except ImportError:
# Python 2.4 doesn't have check_call, so we reimplement it
from subprocess import call
def check_call(*popenargs, **kwargs):
retcode = call(*popenargs, **kwargs)
if retcode:
cmd = kwargs.get("args")
if cmd is None:
cmd = popenargs[0]
raise Exception("Command '%s' returned non-zero exit status %d" % (cmd, retcode))
check_call(*popenargs, **kwargs)