Skip to content

Commit 00faff4

Browse files
committed
If even just one test has Any type then the whole expression will be Any
1 parent d11b4bc commit 00faff4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

mypy/checker.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1833,8 +1833,7 @@ def visit_except_handler_test(self, n: Node) -> Type:
18331833

18341834
for ttype in test_types:
18351835
if isinstance(ttype, AnyType):
1836-
all_types.append(ttype)
1837-
continue
1836+
return AnyType()
18381837

18391838
if not isinstance(ttype, FunctionLike):
18401839
self.fail(messages.INVALID_EXCEPTION_TYPE, n)

0 commit comments

Comments
 (0)