##// END OF EJS Templates
[PATCH] Fix use of util.CommandError...
mpm@selenic.com -
r521:0fb8ade0 default
parent child Browse files
Show More
@@ -22,12 +22,14 b' def explain_exit(code):'
22 22 return "stopped by signal %d" % val, val
23 23 raise ValueError("invalid exit code")
24 24
25 def system(cmd, errprefix = "abort"):
25 def system(cmd, errprefix=None):
26 26 """execute a shell command that must succeed"""
27 27 rc = os.system(cmd)
28 28 if rc:
29 errmsg = "%s: %s %s" % (errprefix, os.path.basename(cmd.split(None, 1)[0]),
29 errmsg = "%s %s" % (os.path.basename(cmd.split(None, 1)[0]),
30 30 explain_exit(rc)[0])
31 if errprefix:
32 errmsg = "%s: %s" % (errprefix, errmsg)
31 33 raise CommandError(errmsg)
32 34
33 35 def rename(src, dst):
General Comments 0
You need to be logged in to leave comments. Login now