|
13 | 13 | from mypy import errorcodes as codes, join, message_registry, nodes, operators |
14 | 14 | from mypy.binder import ConditionalTypeBinder, Frame, get_declaration |
15 | 15 | from mypy.checker_shared import CheckerScope, TypeCheckerSharedApi, TypeRange |
| 16 | +from mypy.checker_state import checker_state |
16 | 17 | from mypy.checkmember import ( |
17 | 18 | MemberContext, |
18 | 19 | analyze_class_attribute_access, |
@@ -455,7 +456,7 @@ def check_first_pass(self) -> None: |
455 | 456 | Deferred functions will be processed by check_second_pass(). |
456 | 457 | """ |
457 | 458 | self.recurse_into_functions = True |
458 | | - with state.strict_optional_set(self.options.strict_optional), state.type_checker_set(self): |
| 459 | + with state.strict_optional_set(self.options.strict_optional), checker_state.set(self): |
459 | 460 | self.errors.set_file( |
460 | 461 | self.path, self.tree.fullname, scope=self.tscope, options=self.options |
461 | 462 | ) |
@@ -496,7 +497,7 @@ def check_second_pass( |
496 | 497 | This goes through deferred nodes, returning True if there were any. |
497 | 498 | """ |
498 | 499 | self.recurse_into_functions = True |
499 | | - with state.strict_optional_set(self.options.strict_optional), state.type_checker_set(self): |
| 500 | + with state.strict_optional_set(self.options.strict_optional), checker_state.set(self): |
500 | 501 | if not todo and not self.deferred_nodes: |
501 | 502 | return False |
502 | 503 | self.errors.set_file( |
|
0 commit comments