Enable multiprocessing on Windows on unaffected Python versions

The upstream bug in Python is fixed in Python 2.7.11+ and Python 3.2+
This commit is contained in:
schlamar 2016-06-01 07:40:02 +02:00
parent 16686132c1
commit 6922f58ed3
2 changed files with 7 additions and 3 deletions

View file

@ -59,8 +59,8 @@ class BaseQReport(pep8.BaseReport):
def _process_main(self):
if not self._loaded:
# Windows needs to parse again the configuration
from flake8.main import get_style_guide, DEFAULT_CONFIG
get_style_guide(parse_argv=True, config_file=DEFAULT_CONFIG)
from flake8.main import get_style_guide
get_style_guide(parse_argv=True)
for filename in iter(self.task_queue.get, 'DONE'):
self.input_file(filename)

View file

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import os
import sys
try:
import ast
@ -54,7 +55,10 @@ def warn_when_using_jobs(options):
def force_disable_jobs(styleguide):
return is_windows() or is_using_stdin(styleguide.paths)
affected_mp_version = (sys.version_info <= (2, 7, 11) or
(3, 0) <= sys.version_info < (3, 2))
return (is_windows() and affected_mp_version or
is_using_stdin(styleguide.paths))
INT_TYPES = ('int', 'count')