From 6ea03316725dfd38af1f507dba623e807b762580 Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Mon, 24 Jan 2011 23:30:15 +0000 Subject: lastchange: wrap another subprocess call in a try block Avoids throwing an exception when git isn't installed. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72418 0039d316-1c4b-4281-b951-d872f2087c98 --- build/util/lastchange.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'build') diff --git a/build/util/lastchange.py b/build/util/lastchange.py index 3718c54..a530474 100755 --- a/build/util/lastchange.py +++ b/build/util/lastchange.py @@ -25,11 +25,14 @@ def IsGitSVN(directory): # To test whether git-svn has been set up, query the config for any # svn-related configuration. This command exits with an error code # if there aren't any matches, so ignore its output. - status = subprocess.call(['git', 'config', '--get-regexp', '^svn'], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - cwd=directory) - return status == 0 + try: + status = subprocess.call(['git', 'config', '--get-regexp', '^svn'], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + cwd=directory) + return status == 0 + except OSError: + return False def FetchSVNRevision(command, directory): -- cgit v1.1