Issue 18115: Use importlib.util.module_to_load in all loaders in importlib (original) (raw)

Issue18115

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/62315

classification

Title: Use importlib.util.module_to_load in all loaders in importlib
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.4

process

Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: brett.cannon, python-dev
Priority: normal Keywords: easy

Created on 2013-06-01 03:15 by brett.cannon, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg190435 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-06-01 03:15
BuiltinImporter, FrozenImporter, and ExtensionFileLoader all have their own custom code to manage clearing sys.modules if something goes wrong. Should see if any of them would break if they used importlib.util.module_to_load. And if they would break thanks to any pre-existing module in sys.modules, then add a keyword argument to suppress creating a new module.
msg190437 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-06-01 03:25
Turns out BuiltinImporter doesn't like having a pre-existing module, so a new keyword argument will be necessary to allow for only the cleanup code to run and not the construction of a new module.
msg191290 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-06-16 21:23
New changeset 205aa49e5cd5 by Brett Cannon in branch 'default': Issue #18115: Abstract out managing the cleanup of modules to use in http://hg.python.org/cpython/rev/205aa49e5cd5
History
Date User Action Args
2022-04-11 14:57:46 admin set github: 62315
2013-06-16 21:23:27 brett.cannon set status: open -> closedresolution: fixedstage: needs patch -> resolved
2013-06-16 21:23:15 python-dev set nosy: + python-devmessages: +
2013-06-01 03:25:18 brett.cannon set messages: +
2013-06-01 03:15:34 brett.cannon create