MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / load

Method load

tools/python-3.11.9-amd64/Lib/pickle.py:1187–1215  ·  view source on GitHub ↗

Read a pickled object representation from the open file. Return the reconstituted object hierarchy specified in the file.

(self)

Source from the content-addressed store, hash-verified

1185 self.fix_imports = fix_imports
1186
1187 def load(self):
1188 """Read a pickled object representation from the open file.
1189
1190 Return the reconstituted object hierarchy specified in the file.
1191 """
1192 # Check whether Unpickler was initialized correctly. This is
1193 # only needed to mimic the behavior of _pickle.Unpickler.dump().
1194 if not hasattr(self, "_file_read"):
1195 raise UnpicklingError("Unpickler.__init__() was not called by "
1196 "%s.__init__()" % (self.__class__.__name__,))
1197 self._unframer = _Unframer(self._file_read, self._file_readline)
1198 self.read = self._unframer.read
1199 self.readinto = self._unframer.readinto
1200 self.readline = self._unframer.readline
1201 self.metastack = []
1202 self.stack = []
1203 self.append = self.stack.append
1204 self.proto = 0
1205 read = self.read
1206 dispatch = self.dispatch
1207 try:
1208 while True:
1209 key = read(1)
1210 if not key:
1211 raise EOFError
1212 assert isinstance(key, bytes_types)
1213 dispatch[key[0]](self)
1214 except _Stop as stopinst:
1215 return stopinst.value
1216
1217 # Return a list of items pushed in the stack after last MARK instruction.
1218 def pop_mark(self):

Callers 12

read_codeFunction · 0.45
__getitem__Method · 0.45
set_locationMethod · 0.45
nextMethod · 0.45
previousMethod · 0.45
firstMethod · 0.45
lastMethod · 0.45
_loadFunction · 0.45
_loadsFunction · 0.45
load_statsMethod · 0.45
_mac_ver_xmlFunction · 0.45
__init__Method · 0.45

Calls 3

UnpicklingErrorClass · 0.85
_UnframerClass · 0.85
readFunction · 0.70

Tested by

no test coverage detected