From 1e629b3bd7355bf730a5c1971a259b839fd37ead Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Mon, 13 Sep 2010 18:53:22 +0000 Subject: [PATCH] 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 --- PRESUBMIT.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 4ca213bb07..2c176fc06c 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -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.')]