diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-01-16 21:07:55 +0200 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-01-16 21:07:55 +0200 |
commit | 4996100df7f515b23d0023cc674691c6f1448712 (patch) | |
tree | 63447ef4d0390f747385f0848412922e28f582af | |
parent | 128d412092de096691be410c0cf2147855937a8a (diff) | |
download | pylint-4996100df7f515b23d0023cc674691c6f1448712.tar.gz |
Fix a crash which occurred when using multiple jobs and the files
given as argument didn't exist at all.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | lint.py | 4 | ||||
-rw-r--r-- | test/test_self.py | 4 |
3 files changed, 8 insertions, 3 deletions
@@ -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 @@ -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() |