From 4996100df7f515b23d0023cc674691c6f1448712 Mon Sep 17 00:00:00 2001 From: Claudiu Popa Date: Fri, 16 Jan 2015 21:07:55 +0200 Subject: Fix a crash which occurred when using multiple jobs and the files given as argument didn't exist at all. --- ChangeLog | 3 +++ lint.py | 4 ++-- test/test_self.py | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 584830f..737ca00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -39,6 +39,9 @@ ChangeLog for Pylint * Don't compile test files when installing. + * Fix a crash which occurred when using multiple jobs and the files + given as argument didn't exist at all. + 2014-11-23 -- 1.4.0 diff --git a/lint.py b/lint.py index c438420..e10ae56 100644 --- a/lint.py +++ b/lint.py @@ -674,11 +674,11 @@ class PyLinter(configuration.OptionsManagerMixIn, self._do_check(files_or_modules) else: # Hack that permits running pylint, on Windows, with -m switch - # and with --jobs, as in 'py -2 -m pylint .. --jobs'. + # and with --jobs, as in 'python -2 -m pylint .. --jobs'. # For more details why this is needed, # see Python issue http://bugs.python.org/issue10845. - mock_main = six.PY2 and __name__ != '__main__' # -m switch + mock_main = __name__ != '__main__' # -m switch if mock_main: sys.modules['__main__'] = sys.modules[__name__] try: diff --git a/test/test_self.py b/test/test_self.py index aa23a2f..e94d958 100644 --- a/test/test_self.py +++ b/test/test_self.py @@ -137,6 +137,9 @@ class RunTC(unittest.TestCase): self._runtest(['-j 2', 'pylint/test/functional/arguments.py', 'pylint/test/functional/bad_continuation.py'], code=1) + def test_parallel_execution_missing_arguments(self): + self._runtest(['-j 2', 'not_here', 'not_here_too'], code=1) + def test_py3k_option(self): # Test that --py3k flag works. rc_code = 2 if six.PY2 else 0 @@ -145,6 +148,5 @@ class RunTC(unittest.TestCase): code=rc_code) - if __name__ == '__main__': unittest.main() -- cgit v1.2.1