Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(253)

Unified Diff: Lib/inspect.py

Issue 13487: inspect.getmodule fails when module imports change sys.modules
Patch Set: Created 1 year, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/inspect.py Sun Nov 27 00:19:53 2011 +0100
+++ b/Lib/inspect.py Sat Nov 26 18:49:16 2011 -0800
@@ -482,7 +482,7 @@
return sys.modules.get(modulesbyfile[file])
# Update the filename to module name cache and check yet again
# Copy sys.modules in order to cope with changes while iterating
- for modname, module in sys.modules.items():
+ for modname, module in list(sys.modules.items()):
if ismodule(module) and hasattr(module, '__file__'):
f = module.__file__
if f == _filesbymodname.get(modname, None):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld cbc36f91f3f7