]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
catch EnvironmentError from attempt to invoke darcs using subprocess module
authorZooko O'Whielacronx <zooko@zooko.com>
Mon, 11 Jun 2007 18:59:57 +0000 (11:59 -0700)
committerZooko O'Whielacronx <zooko@zooko.com>
Mon, 11 Jun 2007 18:59:57 +0000 (11:59 -0700)
misc/make-version.py

index f52d5445986193430f79692092e3b4ad1f84622b..49c60ca210ffa8bd2dbe8828c91e29a586c32c48 100644 (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