Skip to content

Commit 0ddfcea

Browse files
committed
Remove Python 3.7 compatibility code
1 parent 0e8f745 commit 0ddfcea

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

src/pep8ext_naming.py

+4-15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Checker of PEP-8 Naming Conventions."""
22
import ast
3-
import sys
43
from ast import iter_child_nodes
54
from collections import deque
65
from fnmatch import fnmatchcase
@@ -11,8 +10,6 @@
1110

1211
__version__ = '0.13.3'
1312

14-
PYTHON_VERSION = sys.version_info[:3]
15-
1613
CLASS_METHODS = frozenset((
1714
'__new__',
1815
'__init_subclass__',
@@ -32,14 +29,10 @@
3229
}
3330
FUNC_NODES = (ast.FunctionDef, ast.AsyncFunctionDef)
3431

35-
if PYTHON_VERSION < (3, 8):
36-
def get_arg_name_tuples(node):
37-
groups = (node.args.args, node.args.kwonlyargs)
38-
return [(arg, arg.arg) for args in groups for arg in args]
39-
else:
40-
def get_arg_name_tuples(node):
41-
groups = (node.args.posonlyargs, node.args.args, node.args.kwonlyargs)
42-
return [(arg, arg.arg) for args in groups for arg in args]
32+
33+
def get_arg_name_tuples(node):
34+
groups = (node.args.posonlyargs, node.args.args, node.args.kwonlyargs)
35+
return [(arg, arg.arg) for args in groups for arg in args]
4336

4437

4538
class _ASTCheckMeta(type):
@@ -54,12 +47,8 @@ def __init__(cls, class_name, bases, namespace):
5447
def _err(self, node, code, **kwargs):
5548
lineno, col_offset = node.lineno, node.col_offset
5649
if isinstance(node, ast.ClassDef):
57-
if PYTHON_VERSION < (3, 8):
58-
lineno += len(node.decorator_list)
5950
col_offset += 6
6051
elif isinstance(node, FUNC_NODES):
61-
if PYTHON_VERSION < (3, 8):
62-
lineno += len(node.decorator_list)
6352
col_offset += 4
6453
code_str = getattr(self, code)
6554
if kwargs:

0 commit comments

Comments
 (0)