MCPcopy Index your code
hub / github.com/RustPython/RustPython / find_class

Method find_class

Lib/pickle.py:1684–1701  ·  view source on GitHub ↗
(self, module, name)

Source from the content-addressed store, hash-verified

1682 self.append(obj)
1683
1684 def find_class(self, module, name):
1685 # Subclasses may override this.
1686 sys.audit('pickle.find_class', module, name)
1687 if self.proto < 3 and self.fix_imports:
1688 if (module, name) in _compat_pickle.NAME_MAPPING:
1689 module, name = _compat_pickle.NAME_MAPPING[(module, name)]
1690 elif module in _compat_pickle.IMPORT_MAPPING:
1691 module = _compat_pickle.IMPORT_MAPPING[module]
1692 __import__(module, level=0)
1693 if self.proto >= 4 and '.' in name:
1694 dotted_path = name.split('.')
1695 try:
1696 return _getattribute(sys.modules[module], dotted_path)
1697 except AttributeError:
1698 raise AttributeError(
1699 f"Can't resolve path {name!r} on module {module!r}")
1700 else:
1701 return getattr(sys.modules[module], name)
1702
1703 def load_reduce(self):
1704 stack = self.stack

Callers 4

load_instMethod · 0.95
load_globalMethod · 0.95
load_stack_globalMethod · 0.95
get_extensionMethod · 0.95

Calls 4

_getattributeFunction · 0.85
getattrFunction · 0.85
__import__Function · 0.50
splitMethod · 0.45

Tested by

no test coverage detected