mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-30 02:46:52 +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.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
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ def get_parser():
|
|||
except ValueError:
|
||||
pass
|
||||
|
||||
if multiprocessing:
|
||||
if multiprocessing and not is_windows():
|
||||
try:
|
||||
auto = multiprocessing.cpu_count() or 1
|
||||
except NotImplementedError:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import os
|
||||
|
||||
try:
|
||||
import ast
|
||||
|
|
@ -43,6 +44,11 @@ def is_flag(val):
|
|||
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):
|
||||
"""Return true if flag is on"""
|
||||
return str(val).upper() in ('1', 'T', 'TRUE', 'ON')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue