summaryrefslogtreecommitdiffstats
path: root/PRESUBMIT.py
diff options
context:
space:
mode:
authoradamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-30 01:44:34 +0000
committeradamk@chromium.org <adamk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-30 01:44:34 +0000
commitf0d330f393cfda9482d807b584e8868250c21dc3 (patch)
treedca42c6057ceba854c3f346dcab4e7b42ddccf4a /PRESUBMIT.py
parent5ca4eef1a3dd98e9d0e4b0cfd917070bea2a04d2 (diff)
downloadchromium_src-f0d330f393cfda9482d807b584e8868250c21dc3.zip
chromium_src-f0d330f393cfda9482d807b584e8868250c21dc3.tar.gz
chromium_src-f0d330f393cfda9482d807b584e8868250c21dc3.tar.bz2
Fix _CheckFilePermissions to actually flag presubmit errors
Previously it was misusing subprocess.Popen such that no output was ever captured from checkperms.py. Also, changed the check to use input_api.subprocess instead of importing subprocess. R=maruel@chromium.org NOTRY=true Review URL: https://codereview.chromium.org/143013004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247805 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT.py')
-rw-r--r--PRESUBMIT.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index d19fa7f..2e6c077 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -10,7 +10,6 @@ for more details about the presubmit API built into gcl.
import re
-import subprocess
import sys
@@ -526,14 +525,13 @@ def _CheckFilePermissions(input_api, output_api):
input_api.change.RepositoryRoot()]
for f in input_api.AffectedFiles():
args += ['--file', f.LocalPath()]
- errors = []
- (errors, stderrdata) = subprocess.Popen(args).communicate()
-
- results = []
+ checkperms = input_api.subprocess.Popen(args,
+ stdout=input_api.subprocess.PIPE)
+ errors = checkperms.communicate()[0].strip()
if errors:
- results.append(output_api.PresubmitError('checkperms.py failed.',
- errors))
- return results
+ return [output_api.PresubmitError('checkperms.py failed.',
+ errors.splitlines())]
+ return []
def _CheckNoAuraWindowPropertyHInHeaders(input_api, output_api):