Skip to content

Commit 66d03da

Browse files
authored
Fix find occurrences flag (#15528)
1 parent 05c81d6 commit 66d03da

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mypy/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,12 +1349,12 @@ def set_strict_flags() -> None:
13491349

13501350
# Set build flags.
13511351
if special_opts.find_occurrences:
1352-
state.find_occurrences = special_opts.find_occurrences.split(".")
1353-
assert state.find_occurrences is not None
1354-
if len(state.find_occurrences) < 2:
1352+
_find_occurrences = tuple(special_opts.find_occurrences.split("."))
1353+
if len(_find_occurrences) < 2:
13551354
parser.error("Can only find occurrences of class members.")
1356-
if len(state.find_occurrences) != 2:
1355+
if len(_find_occurrences) != 2:
13571356
parser.error("Can only find occurrences of non-nested class members.")
1357+
state.find_occurrences = _find_occurrences # type: ignore[assignment]
13581358

13591359
# Set reports.
13601360
for flag, val in vars(special_opts).items():

0 commit comments

Comments
 (0)