classification
Title: Update PyImport_ImportFrozenModuleObject() to set __package__
Type: behavior Stage: needs patch
Components: Interpreter Core Versions: Python 3.4
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: brett.cannon
Priority: low Keywords: easy

Created on 2013-06-01 03:13 by brett.cannon, last changed 2013-06-10 23:24 by brett.cannon.

Messages (3)
msg190434 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-06-01 03:13
_imp.init_frozen is not really necessary; you can implement imports entirely using the other frozen-related functions. Because of that it's probably better to simply rewrite PyImport_ImportFrozenModuleObject() to use importlib to make the code easier to maintain and help guarantee consistency with other code.
msg190938 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-06-10 23:24
Forgot that PyImport_ImportFrozenModule() uses PyImport_ImportFrozenModuleObject() and the former is used to load _frozen_importlib, so can't drop the function. The code could still be updated, though, to set __package__ before the code object is executed. That probably wouldn't be too hard to do by factoring out the code in PyImport_ImportModuleLevelObject which calculates the parent there.
msg190939 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-06-10 23:24
Marking as easy for any C coders.
History
Date User Action Args
2013-06-10 23:24:46brett.cannonsetkeywords: + easy

messages: + msg190939
2013-06-10 23:24:31brett.cannonsetpriority: normal -> low
assignee: brett.cannon ->
messages: + msg190938

title: Update PyImport_ImportFrozenModuleObject() to use importlib -> Update PyImport_ImportFrozenModuleObject() to set __package__
2013-06-01 03:13:19brett.cannoncreate