Beispiel #1
0
 def visit_type_info(self, info: TypeInfo) -> None:
     save_info = self.current_info
     try:
         self.current_info = info
         if info.defn:
             info.defn.accept(self)
         if info.names:
             self.visit_symbol_table(info.names)
         if info.bases:
             for base in info.bases:
                 base.accept(self.type_fixer)
         if info._promote:
             info._promote.accept(self.type_fixer)
         if info.tuple_type:
             info.tuple_type.accept(self.type_fixer)
         if info.typeddict_type:
             info.typeddict_type.accept(self.type_fixer)
         if info.declared_metaclass:
             info.declared_metaclass.accept(self.type_fixer)
         if info.metaclass_type:
             info.metaclass_type.accept(self.type_fixer)
         if info._mro_refs:
             info.mro = [
                 lookup_qualified_typeinfo(self.modules, name,
                                           self.allow_missing)
                 for name in info._mro_refs
             ]
             info._mro_refs = None
     finally:
         self.current_info = save_info
Beispiel #2
0
 def visit_type_info(self, info: TypeInfo) -> None:
     save_info = self.current_info
     try:
         self.current_info = info
         if info.defn:
             info.defn.accept(self)
         if info.names:
             self.visit_symbol_table(info.names)
         if info.bases:
             for base in info.bases:
                 base.accept(self.type_fixer)
         if info._promote:
             info._promote.accept(self.type_fixer)
         if info.tuple_type:
             info.tuple_type.accept(self.type_fixer)
         if info.typeddict_type:
             info.typeddict_type.accept(self.type_fixer)
         if info.declared_metaclass:
             info.declared_metaclass.accept(self.type_fixer)
         if info.metaclass_type:
             info.metaclass_type.accept(self.type_fixer)
         if info._mro_refs:
             # If the class is a "-redefinition", then its
             # reference to itself might be busted, so just use the
             # info instead of looking up the first element. Ew.
             info.mro = [info] + [
                 lookup_qualified_typeinfo(self.modules, name,
                                           self.allow_missing)
                 for name in info._mro_refs[1:]
             ]
             info._mro_refs = None
     finally:
         self.current_info = save_info
Beispiel #3
0
 def visit_type_info(self, info: TypeInfo) -> None:
     save_info = self.current_info
     try:
         self.current_info = info
         if info.defn:
             info.defn.accept(self)
         if info.names:
             self.visit_symbol_table(info.names)
         if info.bases:
             for base in info.bases:
                 base.accept(self.type_fixer)
         if info._promote:
             info._promote.accept(self.type_fixer)
         if info.tuple_type:
             info.tuple_type.accept(self.type_fixer)
         if info.typeddict_type:
             info.typeddict_type.accept(self.type_fixer)
         if info.declared_metaclass:
             info.declared_metaclass.accept(self.type_fixer)
         if info.metaclass_type:
             info.metaclass_type.accept(self.type_fixer)
         if info._mro_refs:
             info.mro = [lookup_qualified_typeinfo(self.modules, name, self.quick_and_dirty)
                         for name in info._mro_refs]
             info._mro_refs = None
     finally:
         self.current_info = save_info