Skip to content

Commit 5d43462

Browse files
committedMar 31, 2021
clean up version_info references
1 parent 018dbcd commit 5d43462

File tree

3 files changed

+12
-28
lines changed

3 files changed

+12
-28
lines changed
 

‎src/flake8/checker.py

+5-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import itertools
55
import logging
66
import signal
7-
import sys
87
import tokenize
98
from typing import Dict
109
from typing import List
@@ -41,14 +40,11 @@
4140

4241
def _multiprocessing_is_fork(): # type () -> bool
4342
"""Class state is only preserved when using the `fork` strategy."""
44-
if sys.version_info >= (3, 4):
45-
return (
46-
multiprocessing
47-
# https://github.com/python/typeshed/pull/3415
48-
and multiprocessing.get_start_method() == "fork" # type: ignore
49-
)
50-
else:
51-
return multiprocessing and not utils.is_windows()
43+
return (
44+
multiprocessing
45+
# https://github.com/python/typeshed/pull/3415
46+
and multiprocessing.get_start_method() == "fork" # type: ignore
47+
)
5248

5349

5450
class Manager:

‎src/flake8/utils.py

+7-18
Original file line numberDiff line numberDiff line change
@@ -401,24 +401,13 @@ def parameters_for(plugin):
401401
if is_class: # The plugin is a class
402402
func = plugin.plugin.__init__
403403

404-
if sys.version_info < (3, 3):
405-
argspec = inspect.getargspec(func)
406-
start_of_optional_args = len(argspec[0]) - len(argspec[-1] or [])
407-
parameter_names = argspec[0]
408-
parameters = collections.OrderedDict(
409-
[
410-
(name, position < start_of_optional_args)
411-
for position, name in enumerate(parameter_names)
412-
]
413-
)
414-
else:
415-
parameters = collections.OrderedDict(
416-
[
417-
(parameter.name, parameter.default is parameter.empty)
418-
for parameter in inspect.signature(func).parameters.values()
419-
if parameter.kind == parameter.POSITIONAL_OR_KEYWORD
420-
]
421-
)
404+
parameters = collections.OrderedDict(
405+
[
406+
(parameter.name, parameter.default is parameter.empty)
407+
for parameter in inspect.signature(func).parameters.values()
408+
if parameter.kind == parameter.POSITIONAL_OR_KEYWORD
409+
]
410+
)
422411

423412
if is_class:
424413
parameters.pop("self", None)

‎tests/unit/test_utils.py

-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ def test_matches_filename_for_excluding_dotfiles():
308308
assert not utils.matches_filename('..', ('.*',), '', logger)
309309

310310

311-
@pytest.mark.xfail(sys.version_info < (3,), reason='py3+ only behaviour')
312311
def test_stdin_get_value_crlf():
313312
"""Ensure that stdin is normalized from crlf to lf."""
314313
stdin = io.TextIOWrapper(io.BytesIO(b'1\r\n2\r\n'), 'UTF-8')

0 commit comments

Comments
 (0)
Please sign in to comment.