]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Issue #17358: imp.load_source() and load_compiled() should now return
authorBrett Cannon <brett@python.org>
Sun, 28 Apr 2013 15:53:26 +0000 (11:53 -0400)
committerBrett Cannon <brett@python.org>
Sun, 28 Apr 2013 15:53:26 +0000 (11:53 -0400)
commit5a4c233a9e6450919ddea78d7df22a76b4758322
treeca34b88be6c69243904e3e3cde0d9e7927d0dc92
parent9330a94467af5b9878ef0fb30da45d964cd735df
Issue #17358: imp.load_source() and load_compiled() should now return
modules which will typically work when reloaded.

A hack is used to support these functions as their API allowed them to
pass in a file object but then operate as if import had loaded them.
Unfortunately the hack kept a reference around for the file object
passed in which would be unusable on reload since it had been closed.
The solution is to simply use the hack for the initial load but then a
proper loader on the module so that imp.reload() at least has a chance
to work.
Lib/imp.py
Misc/NEWS