From c98b04726650cd6ccb22c458c7fb34c5b87a4e90 Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Fri, 24 Sep 2010 18:37:42 +0000 Subject: [PATCH] Strip newline/whitespace from 'which' output when looking for non-standard-named depot_tools directory in git cl hooks python script. Otherwise, python ignores the path. Patch contributed by James Jones @ nvidia. BUG=chromium-os:7007 Review URL: http://codereview.chromium.org/3467013 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@60499 0039d316-1c4b-4281-b951-d872f2087c98 --- git-cl-upload-hook | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-cl-upload-hook b/git-cl-upload-hook index ab19320371..e39fc26ee7 100755 --- a/git-cl-upload-hook +++ b/git-cl-upload-hook @@ -21,7 +21,7 @@ for path in os.environ.get("PATH").split(os.pathsep): if not depot_tools_path: # Grab a `which gclient', which gives first match # `which' also uses PATH, but is not restricted to specific directory name - path = Popen(["which", "gclient"], stdout=PIPE).communicate()[0] + path = Popen(["which", "gclient"], stdout=PIPE).communicate()[0].strip() if path: depot_tools_path = path.replace("/gclient","")