Skip to content

Commit 1958c3f

Browse files
committed
refactor: no need for a version check since we run mypy on late python now
1 parent 8891312 commit 1958c3f

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

coverage/phystokens.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -152,19 +152,16 @@ def source_token_lines(source: str) -> TSourceTokenLines:
152152
if keyword.iskeyword(ttext):
153153
# Hard keywords are always keywords.
154154
tok_class = "key"
155-
elif sys.version_info >= (3, 10): # PYVERSIONS
156-
# Need the version_info check to keep mypy from borking
157-
# on issoftkeyword here.
158-
if env.PYBEHAVIOR.soft_keywords and keyword.issoftkeyword(ttext):
159-
# Soft keywords appear at the start of their line.
160-
if len(line) == 0:
161-
is_start_of_line = True
162-
elif (len(line) == 1) and line[0][0] == "ws":
163-
is_start_of_line = True
164-
else:
165-
is_start_of_line = False
166-
if is_start_of_line and sline in soft_key_lines:
167-
tok_class = "key"
155+
elif env.PYBEHAVIOR.soft_keywords and keyword.issoftkeyword(ttext):
156+
# Soft keywords appear at the start of their line.
157+
if len(line) == 0:
158+
is_start_of_line = True
159+
elif (len(line) == 1) and line[0][0] == "ws":
160+
is_start_of_line = True
161+
else:
162+
is_start_of_line = False
163+
if is_start_of_line and sline in soft_key_lines:
164+
tok_class = "key"
168165
line.append((tok_class, part))
169166
mark_end = True
170167
scol = 0

0 commit comments

Comments
 (0)