(self, module, name)
| 1713 | self.append(obj) |
| 1714 | |
| 1715 | def find_class(self, module, name): |
| 1716 | # Subclasses may override this. |
| 1717 | sys.audit('pickle.find_class', module, name) |
| 1718 | if self.proto < 3 and self.fix_imports: |
| 1719 | if (module, name) in _compat_pickle.NAME_MAPPING: |
| 1720 | module, name = _compat_pickle.NAME_MAPPING[(module, name)] |
| 1721 | elif module in _compat_pickle.IMPORT_MAPPING: |
| 1722 | module = _compat_pickle.IMPORT_MAPPING[module] |
| 1723 | __import__(module, level=0) |
| 1724 | if self.proto >= 4 and '.' in name: |
| 1725 | dotted_path = name.split('.') |
| 1726 | try: |
| 1727 | return _getattribute(sys.modules[module], dotted_path) |
| 1728 | except AttributeError: |
| 1729 | raise AttributeError( |
| 1730 | f"Can't resolve path {name!r} on module {module!r}") |
| 1731 | else: |
| 1732 | return getattr(sys.modules[module], name) |
| 1733 | |
| 1734 | def load_reduce(self): |
| 1735 | stack = self.stack |
no test coverage detected