SIGN IN SIGN UP
python / cpython UNCLAIMED

The Python programming language

72137 0 45 Python

bpo-45324: Capture data in FrozenImporter.find_spec() to use in exec_module(). (gh-28633)

Before this change we end up duplicating effort and throwing away data in FrozenImporter.find_spec().  Now we do the work once in find_spec() and the only thing we do in FrozenImporter.exec_module() is turn the raw frozen data into a code object and then exec it.

We've added _imp.find_frozen(), add an arg to _imp.get_frozen_object(), and updated FrozenImporter.  We've also moved some code around to reduce duplication, get a little more consistency in outcomes, and be more efficient.

Note that this change is mostly necessary if we want to set __file__ on frozen stdlib modules. (See https://bugs.python.org/issue21736.)

https://bugs.python.org/issue45324
E
Eric Snow committed
c3d9ac8b340fcbf54cee865737e67f11fcd70ed3
Parent: b9bb748
Committed by GitHub <noreply@github.com> on 10/5/2021, 4:01:27 PM