From 67ec5fae41a5f7aa30ad02e3b19dfdd0bd3f4002 Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Wed, 9 Nov 2011 23:02:09 +0000 Subject: [PATCH] Fix automatic detection when git is not installed subprocess2.check_output() raises an OSError instead of a CalledProcessError when the executable is not found. R=dpranke@chromium.org BUG= TEST= Review URL: http://codereview.chromium.org/8511025 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@109325 0039d316-1c4b-4281-b951-d872f2087c98 --- trychange.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/trychange.py b/trychange.py index d43dc2dc6..78b90a770 100755 --- a/trychange.py +++ b/trychange.py @@ -459,6 +459,9 @@ def GuessVCS(options, path, file_list): ['git', 'rev-parse', '--is-inside-work-tree'], cwd=real_path, stderr=subprocess2.VOID) return GIT(options, path, file_list) + except OSError, e: + if e.errno != errno.ENOENT: + raise except subprocess2.CalledProcessError, e: if e.returncode != errno.ENOENT and e.returncode != 128: # ENOENT == 2 = they don't have git installed.