diff options
| author | Ian Cordasco <graffatcolmingov@gmail.com> | 2016-07-29 06:49:00 -0500 |
|---|---|---|
| committer | Ian Cordasco <graffatcolmingov@gmail.com> | 2016-07-29 07:04:37 -0500 |
| commit | 429d8a196e1ad7317b195b07f0f6a06027d4476f (patch) | |
| tree | 960f0553e802054ea2007002e49e72c4ee43a71a /src/flake8 | |
| parent | 530767d36d1a23b986d62567b8364c263f7270ae (diff) | |
| download | flake8-429d8a196e1ad7317b195b07f0f6a06027d4476f.tar.gz | |
Diable multiprocessing behaviour on Windows
Due to https://bugs.python.org/issue27649, we cannot continue to
expect multiprocessing to work as we expect and document it on Windows.
As such, we are going to revert back to our previous behaviour of
disabling it across all versions of Python on Windows to provide the
default expected behaviour of Flake8 on that Operating System.
Diffstat (limited to 'src/flake8')
| -rw-r--r-- | src/flake8/checker.py | 3 | ||||
| -rw-r--r-- | src/flake8/utils.py | 12 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/flake8/checker.py b/src/flake8/checker.py index d331b0c..57fd896 100644 --- a/src/flake8/checker.py +++ b/src/flake8/checker.py @@ -167,7 +167,8 @@ class Manager(object): if (utils.is_windows() and not utils.can_run_multiprocessing_on_windows()): - LOG.warning('The --jobs option is only available on Windows on ' + LOG.warning('The --jobs option is not available on Windows due to' + ' a bug (https://bugs.python.org/issue27649) in ' 'Python 2.7.11+ and 3.3+. We have detected that you ' 'are running an unsupported version of Python on ' 'Windows. Ignoring --jobs arguments.') diff --git a/src/flake8/utils.py b/src/flake8/utils.py index 1e18316..55c699e 100644 --- a/src/flake8/utils.py +++ b/src/flake8/utils.py @@ -164,10 +164,20 @@ def is_windows(): return os.name == 'nt' +# NOTE(sigmavirus24): If and when https://bugs.python.org/issue27649 is fixed, +# re-enable multiprocessing support on Windows. def can_run_multiprocessing_on_windows(): # type: () -> bool """Determine if we can use multiprocessing on Windows. + This presently will **always** return False due to a `bug`_ in the + :mod:`multiprocessing` module on Windows. Once fixed, we will check + to ensure that the version of Python contains that fix (via version + inspection) and *conditionally* re-enable support on Windows. + + .. _bug: + https://bugs.python.org/issue27649 + :returns: True if the version of Python is modern enough, otherwise False :rtype: @@ -175,7 +185,7 @@ def can_run_multiprocessing_on_windows(): """ is_new_enough_python27 = (2, 7, 11) <= sys.version_info < (3, 0) is_new_enough_python3 = sys.version_info > (3, 2) - return is_new_enough_python27 or is_new_enough_python3 + return False and (is_new_enough_python27 or is_new_enough_python3) def is_using_stdin(paths): |
