From: Avery Pennarun Date: Wed, 26 Jan 2011 03:32:27 +0000 (-0800) Subject: auto_midx(): report args when failing to call a subprocess. X-Git-Tag: bup-0.22~11 X-Git-Url: https://arthur.barton.de/gitweb/?p=bup.git;a=commitdiff_plain;h=0bd88aa2def7d582834397dd9caf0e62fe485d67 auto_midx(): report args when failing to call a subprocess. The exception from subprocess.call() doesn't report the path it tried to use when it prints the "No such file or directory" error, which isn't helpful when trying to debug problems. Signed-off-by: Avery Pennarun --- diff --git a/lib/bup/git.py b/lib/bup/git.py index 022d347..7781a51 100644 --- a/lib/bup/git.py +++ b/lib/bup/git.py @@ -41,7 +41,12 @@ def repo(sub = ''): def auto_midx(objdir): main_exe = os.environ.get('BUP_MAIN_EXE') or sys.argv[0] args = [main_exe, 'midx', '--auto', '--dir', objdir] - rv = subprocess.call(args, stdout=open('/dev/null', 'w')) + try: + rv = subprocess.call(args, stdout=open('/dev/null', 'w')) + except OSError, e: + # make sure 'args' gets printed to help with debugging + add_error('%r: exception: %s' % (args, e)) + raise if rv: add_error('%r: returned %d' % (args, rv))