Skip to content

Commit

Permalink
fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Jun 27, 2023
1 parent 2aa46bb commit 558b5c3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mypy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1336,12 +1336,13 @@ def set_strict_flags() -> None:

# Set build flags.
if special_opts.find_occurrences:
state.find_occurrences = tuple(special_opts.find_occurrences.split("."))
assert state.find_occurrences is not None
if len(state.find_occurrences) < 2:
_find_occurrences = tuple(special_opts.find_occurrences.split("."))
assert _find_occurrences is not None
if len(_find_occurrences) < 2:
parser.error("Can only find occurrences of class members.")
if len(state.find_occurrences) != 2:
if len(_find_occurrences) != 2:
parser.error("Can only find occurrences of non-nested class members.")
state.find_occurrences = _find_occurrences # type: ignore[assignment]

# Set reports.
for flag, val in vars(special_opts).items():
Expand Down

0 comments on commit 558b5c3

Please sign in to comment.