File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change 44
55import itertools
66from collections import defaultdict
7- from contextlib import contextmanager , nullcontext
7+ from contextlib import ExitStack , contextmanager
88from typing import (
99 AbstractSet ,
1010 Callable ,
@@ -526,17 +526,11 @@ def check_second_pass(
526526 # print("XXX in pass %d, class %s, function %s" %
527527 # (self.pass_num, type_name, node.fullname or node.name))
528528 done .add (node )
529- with (
530- self .tscope .class_scope (active_typeinfo )
531- if active_typeinfo
532- else nullcontext ()
533- ):
534- with (
535- self .scope .push_class (active_typeinfo )
536- if active_typeinfo
537- else nullcontext ()
538- ):
539- self .check_partial (node )
529+ with ExitStack () as stack :
530+ if active_typeinfo :
531+ stack .enter_context (self .tscope .class_scope (active_typeinfo ))
532+ stack .enter_context (self .scope .push_class (active_typeinfo ))
533+ self .check_partial (node )
540534 return True
541535
542536 def check_partial (self , node : DeferredNodeType | FineGrainedDeferredNodeType ) -> None :
You can’t perform that action at this time.
0 commit comments