Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = 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
Comment thread
hauntsaninja marked this conversation as resolved.
Outdated
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