Commit 1e629b3b authored by maruel@chromium.org's avatar maruel@chromium.org

Fix presubmit check for depot_tools on linux and mac.

The class WindowsError is only a builtin on Windows. Use OSError instead.
Also make the exception more comprehensible on the other platforms when
pylint is not installed.

TEST=none
BUG=none

Review URL: http://codereview.chromium.org/3331022

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@59253 0039d316-1c4b-4281-b951-d872f2087c98
parent 7d1ce06e
......@@ -58,9 +58,13 @@ def RunPylint(input_api, output_api):
files.remove('cpplint.py')
try:
proc = input_api.subprocess.Popen(['pylint', '-E'] + files)
except WindowsError:
# It's windows, give up.
return []
except OSError:
if input_api.platform == 'win32':
# It's windows, give up.
return []
else:
return [output_api.PresubmitError(
'Please install pylint with "easy_install pylint"')]
proc.communicate()
if proc.returncode:
return [output_api.PresubmitError('Fix pylint errors first.')]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment