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 4
4
5
5
import itertools
6
6
from collections import defaultdict
7
- from contextlib import contextmanager , nullcontext
7
+ from contextlib import ExitStack , contextmanager
8
8
from typing import (
9
9
AbstractSet ,
10
10
Callable ,
@@ -526,17 +526,11 @@ def check_second_pass(
526
526
# print("XXX in pass %d, class %s, function %s" %
527
527
# (self.pass_num, type_name, node.fullname or node.name))
528
528
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 )
540
534
return True
541
535
542
536
def check_partial (self , node : DeferredNodeType | FineGrainedDeferredNodeType ) -> None :
You can’t perform that action at this time.
0 commit comments