Skip to content

Commit 349292a

Browse files
committed
property watchers --> method get_watchers
1 parent 968ac4b commit 349292a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

mypy/errors.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,7 @@ def _add_error_info(self, file: str, info: ErrorInfo) -> None:
585585
if info.code in (IMPORT, IMPORT_UNTYPED, IMPORT_NOT_FOUND):
586586
self.seen_import_error = True
587587

588-
@property
589-
def watchers(self) -> Iterator[ErrorWatcher]:
588+
def get_watchers(self) -> Iterator[ErrorWatcher]:
590589
"""Yield the `ErrorWatcher` stack from top to bottom."""
591590
i = len(self._watchers)
592591
while i > 0:
@@ -598,7 +597,7 @@ def _filter_error(self, file: str, info: ErrorInfo) -> bool:
598597
process ErrorWatcher stack from top to bottom,
599598
stopping early if error needs to be filtered out
600599
"""
601-
return any(w.on_error(file, info) for w in self.watchers)
600+
return any(w.on_error(file, info) for w in self.get_watchers())
602601

603602
def add_error_info(self, info: ErrorInfo) -> None:
604603
file, lines = info.origin

mypy/messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1750,7 +1750,7 @@ def reveal_type(self, typ: Type, context: Context) -> None:
17501750
# Search for an error watcher that modifies the "normal" behaviour (we do not
17511751
# rely on the normal `ErrorWatcher` filtering approach because we might need to
17521752
# collect the original types for a later unionised response):
1753-
for watcher in self.errors.watchers:
1753+
for watcher in self.errors.get_watchers():
17541754
# The `reveal_type` statement should be ignored:
17551755
if watcher.filter_revealed_type:
17561756
return

0 commit comments

Comments
 (0)