mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
Move some code from importlib.__init__ to importlib._bootstrap that
does not need to be exposed from C code for bootstrapping reasons.
This commit is contained in:
parent
b0f30c9891
commit
c264e3ee20
4 changed files with 52 additions and 42 deletions
|
@ -260,7 +260,7 @@ class PyPycLoader(PyLoader):
|
|||
raw_timestamp = data[4:8]
|
||||
if len(raw_timestamp) < 4:
|
||||
raise EOFError("bad timestamp in {}".format(fullname))
|
||||
pyc_timestamp = marshal._r_long(raw_timestamp)
|
||||
pyc_timestamp = _bootstrap._r_long(raw_timestamp)
|
||||
bytecode = data[8:]
|
||||
# Verify that the magic number is valid.
|
||||
if imp.get_magic() != magic:
|
||||
|
@ -292,7 +292,7 @@ class PyPycLoader(PyLoader):
|
|||
# Generate bytecode and write it out.
|
||||
if not sys.dont_write_bytecode:
|
||||
data = bytearray(imp.get_magic())
|
||||
data.extend(marshal._w_long(source_timestamp))
|
||||
data.extend(_bootstrap._w_long(source_timestamp))
|
||||
data.extend(marshal.dumps(code_object))
|
||||
self.write_bytecode(fullname, data)
|
||||
return code_object
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue