mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-10 14:54:17 +00:00
parent
34a2c12be8
commit
552e298a2c
2 changed files with 8 additions and 2 deletions
|
|
@ -6,7 +6,7 @@ import pep8
|
||||||
|
|
||||||
from flake8 import __version__
|
from flake8 import __version__
|
||||||
from flake8.reporter import multiprocessing, BaseQReport, QueueReport
|
from flake8.reporter import multiprocessing, BaseQReport, QueueReport
|
||||||
from flake8.util import OrderedSet
|
from flake8.util import OrderedSet, is_windows
|
||||||
|
|
||||||
_flake8_noqa = re.compile(r'flake8[:=]\s*noqa', re.I).search
|
_flake8_noqa = re.compile(r'flake8[:=]\s*noqa', re.I).search
|
||||||
|
|
||||||
|
|
@ -49,7 +49,7 @@ def get_parser():
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if multiprocessing:
|
if multiprocessing and not is_windows():
|
||||||
try:
|
try:
|
||||||
auto = multiprocessing.cpu_count() or 1
|
auto = multiprocessing.cpu_count() or 1
|
||||||
except NotImplementedError:
|
except NotImplementedError:
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
import os
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import ast
|
import ast
|
||||||
|
|
@ -43,6 +44,11 @@ def is_flag(val):
|
||||||
return val.upper() in ('1', '0', 'F', 'T', 'TRUE', 'FALSE', 'ON', 'OFF')
|
return val.upper() in ('1', '0', 'F', 'T', 'TRUE', 'FALSE', 'ON', 'OFF')
|
||||||
|
|
||||||
|
|
||||||
|
def is_windows():
|
||||||
|
"""Determine if the system is Windows."""
|
||||||
|
return os.name == 'nt'
|
||||||
|
|
||||||
|
|
||||||
def flag_on(val):
|
def flag_on(val):
|
||||||
"""Return true if flag is on"""
|
"""Return true if flag is on"""
|
||||||
return str(val).upper() in ('1', 'T', 'TRUE', 'ON')
|
return str(val).upper() in ('1', 'T', 'TRUE', 'ON')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue