
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2013-08-09 23:27 byeric.snow, last changed2022-04-11 14:57 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| reload_replaced_module.diff | eric.snow,2013-08-14 06:34 | |||
| Messages (6) | |||
|---|---|---|---|
| msg194776 -(view) | Author: Eric Snow (eric.snow)*![]() | Date: 2013-08-09 23:27 | |
Currently reload() returns the module that loader.load_module() returns, rather than returning the one in sys.modules. This is different from what happens during normal import. I would expect reload() to return what's in sys.modules. Perhaps this got overlooked when we moved reload()? I haven't had a chance to verify, but I do recall that the switch to importlib-based import in 3.3 exposed a bug where importlib wasn't returning the module in sys.modules during normal import. | |||
| msg194827 -(view) | Author: Brett Cannon (brett.cannon)*![]() | Date: 2013-08-10 20:01 | |
I'm sure it's an oversight. | |||
| msg195125 -(view) | Author: Eric Snow (eric.snow)*![]() | Date: 2013-08-14 06:34 | |
Yep. In 2.7 and 3.2 the PyImport_ExecCodeModuleEx() function inPython/importlib.c returns the module found in sys.modules. Here is a patch. I suppose this should be fixed in 2.7 as well. Thoughts? | |||
| msg195177 -(view) | Author: Brett Cannon (brett.cannon)*![]() | Date: 2013-08-14 15:11 | |
I think you mean in 3.3 and yes. =) Patch LGTM so I say fix in 3.3 and merge into default. | |||
| msg195229 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2013-08-15 00:18 | |
New changesete22e7268e58a by Eric Snow in branch '3.3':issue#18698: ensure importlib.reload() returns the module out of sys.modules.http://hg.python.org/cpython/rev/e22e7268e58aNew changeset1af087712e69 by Eric Snow in branch 'default':Closes issue#18698: ensure importlib.reload() returns the module out of sys.modules.http://hg.python.org/cpython/rev/1af087712e69 | |||
| msg195230 -(view) | Author: Eric Snow (eric.snow)*![]() | Date: 2013-08-15 00:23 | |
oops. That commit message for 3.3 should have read "imp.reload()". :) | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:49 | admin | set | github: 62898 |
| 2013-08-15 00:23:16 | eric.snow | set | status: open -> closed resolution: fixed messages: +msg195230 stage: patch review -> resolved |
| 2013-08-15 00:18:33 | python-dev | set | nosy: +python-dev messages: +msg195229 |
| 2013-08-14 15:11:04 | brett.cannon | set | assignee:eric.snow messages: +msg195177 |
| 2013-08-14 06:34:20 | eric.snow | set | files: +reload_replaced_module.diff keywords: +patch messages: +msg195125 stage: patch review |
| 2013-08-10 20:01:14 | brett.cannon | set | messages: +msg194827 |
| 2013-08-09 23:27:18 | eric.snow | create | |