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
experimental/szager/collated-output
maruel@chromium.org 15 years ago
parent 7d1ce06e64
commit 1e629b3bd7

@ -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.')]

Loading…
Cancel
Save