catch EnvironmentError from attempt to invoke darcs using subprocess module

This commit is contained in:
Zooko O'Whielacronx 2007-06-11 11:59:57 -07:00
parent 466083700f
commit c3cdb81c65

View File

@ -70,9 +70,14 @@ def update():
print "no _darcs/ but no version.py either: how did you get this tree?"
return 0
cmd = ["darcs", "changes", "--from-tag=^allmydata-tahoe", "--xml-output"]
p = Popen(cmd, stdout=PIPE)
output = p.communicate()[0]
rc = p.returncode
try:
p = Popen(cmd, stdout=PIPE)
output = p.communicate()[0]
rc = p.returncode
except EnvironmentError, le:
output = "There was an environment error: %s" % (le,)
rc = -1
if rc != 0:
print "unable to run 'darcs changes':"
print output