summaryrefslogtreecommitdiff
path: root/pyflakes/checker.py
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2022-05-30 17:10:58 -0400
committerGitHub <noreply@github.com>2022-05-30 17:10:58 -0400
commitbecbab65bae84e3e19fc388a42dfabcff0c323c8 (patch)
treee0dcd7f13a8bbe2d45a0043df2c3be466f86a7fb /pyflakes/checker.py
parentf736615f32a4bab27c9efeb5b8f8c31702efc4ab (diff)
downloadpyflakes-becbab65bae84e3e19fc388a42dfabcff0c323c8.tar.gz
upgrade flake8 to 4.0.1 (#706)
I removed the erroring type annotations since we are not (yet) using a type checker
Diffstat (limited to 'pyflakes/checker.py')
-rw-r--r--pyflakes/checker.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/pyflakes/checker.py b/pyflakes/checker.py
index 2cb0e3c..6dd4d89 100644
--- a/pyflakes/checker.py
+++ b/pyflakes/checker.py
@@ -151,20 +151,18 @@ VALID_CONVERSIONS = frozenset('diouxXeEfFgGcrsa%')
def _must_match(regex, string, pos):
- # type: (Pattern[str], str, int) -> Match[str]
match = regex.match(string, pos)
assert match is not None
return match
-def parse_percent_format(s): # type: (str) -> Tuple[PercentFormat, ...]
+def parse_percent_format(s):
"""Parses the string component of a `'...' % ...` format call
Copied from https://github.com/asottile/pyupgrade at v1.20.1
"""
def _parse_inner():
- # type: () -> Generator[PercentFormat, None, None]
string_start = 0
string_end = 0
in_fmt = False
@@ -184,7 +182,7 @@ def parse_percent_format(s): # type: (str) -> Tuple[PercentFormat, ...]
else:
key_match = MAPPING_KEY_RE.match(s, i)
if key_match:
- key = key_match.group(1) # type: Optional[str]
+ key = key_match.group(1)
i = key_match.end()
else:
key = None
@@ -814,8 +812,8 @@ class _TypeableVisitor(ast.NodeVisitor):
https://www.python.org/dev/peps/pep-0484/#type-comments
"""
def __init__(self):
- self.typeable_lines = [] # type: List[int]
- self.typeable_nodes = {} # type: Dict[int, ast.AST]
+ self.typeable_lines = []
+ self.typeable_nodes = {}
def _typeable(self, node):
# if there is more than one typeable thing on a line last one wins