classification
Title: imp.new_module does not function correctly if the module is returned from a function and used directly
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.6, Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, jkp (2)
Priority: Keywords

Created on 2009-10-15 11:24 by jkp, last changed 2009-10-15 15:45 by benjamin.peterson.

Files
File name Uploaded Description Edit Remove
testcase.py jkp, 2009-10-15 11:24 Testcase demonstrating the issue.
testcase.py jkp, 2009-10-15 11:34
Messages (3)
msg94082 - (view) Author: Jamie Kirkpatrick (jkp) Date: 2009-10-15 11:24
See the testcase included.  If you instead assign the result of the 
get_module() call to a variable and then make the call to the function 
defined in that module it works as expected.
msg94083 - (view) Author: Jamie Kirkpatrick (jkp) Date: 2009-10-15 11:34
Updated the testcase to show that the __dict__ for the module is incorrect 
unless the module is assigned to a temp variable.
msg94095 - (view) Author: Benjamin Peterson (benjamin.peterson) Date: 2009-10-15 15:45
Fixed in r75437.
History
Date User Action Args
2009-10-15 15:45:25benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg94095

resolution: fixed
2009-10-15 11:34:07jkpsetfiles: + testcase.py

messages: + msg94083
2009-10-15 11:24:51jkpcreate