Skip to content

Commit

Permalink
Fix find occurrences flag (#15528)
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja authored Jun 29, 2023
1 parent 05c81d6 commit 66d03da
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mypy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1349,12 +1349,12 @@ def set_strict_flags() -> None:

# Set build flags.
if special_opts.find_occurrences:
state.find_occurrences = 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("."))
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 66d03da

Please sign in to comment.