aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/rcs.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2008-11-13 13:10:13 -0500
committerW. Trevor King <wking@drexel.edu>2008-11-13 13:10:13 -0500
commitc5d7551e6a6e98bb6da7c7d11360224edfda2f14 (patch)
tree212ac0f61c99e1290a131ca0655a31b5dbfb0eb6 /libbe/rcs.py
parent9055757a1b30c55798173f2454de8d4fa0676d40 (diff)
downloadbugseverywhere-c5d7551e6a6e98bb6da7c7d11360224edfda2f14.tar.gz
* use python2.4/2.5 compatible import of ElementTree
* catch Popen() calls to missing VCS binaries * test.py should only test installed backends
Diffstat (limited to 'libbe/rcs.py')
-rw-r--r--libbe/rcs.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/libbe/rcs.py b/libbe/rcs.py
index 77d6c9a..4487fba 100644
--- a/libbe/rcs.py
+++ b/libbe/rcs.py
@@ -59,12 +59,16 @@ class CommandError(Exception):
self.status = status
def invoke(args, expect=(0,), cwd=None):
- if sys.platform != "win32":
- q = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE, cwd=cwd)
- else:
- # win32 don't have os.execvp() so have to run command in a shell
- q = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=True,
- cwd=cwd)
+ try :
+ if sys.platform != "win32":
+ q = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE, cwd=cwd)
+ else:
+ # win32 don't have os.execvp() so have to run command in a shell
+ q = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=True,
+ cwd=cwd)
+ except OSError, e :
+ strerror = "%s\nwhile executing %s" % (e.args[1], args)
+ raise CommandError(strerror, e.args[0])
output, error = q.communicate()
status = q.wait()
if status not in expect: