[Python-checkins] r52375 - sandbox/trunk/import_in_py/importer.py

brett.cannon python-checkins at python.org
Wed Oct 18 03:33:00 CEST 2006


Author: brett.cannon
Date: Wed Oct 18 03:33:00 2006
New Revision: 52375
Modified:
 sandbox/trunk/import_in_py/importer.py
Log:
Add a comment about why an entry needs to be put into sys.modules before the
handler is called.
Modified: sandbox/trunk/import_in_py/importer.py
==============================================================================
--- sandbox/trunk/import_in_py/importer.py	(original)
+++ sandbox/trunk/import_in_py/importer.py	Wed Oct 18 03:33:00 2006
@@ -249,6 +249,8 @@
 return sys.modules[fullname]
 except KeyError:
 new_module = imp.new_module(fullname)
+ # Need an entry in sys.modules in order to prevent any problems
+ # with circular imports.
 sys.modules[fullname] = new_module
 # If handler returns a different module these should already be
 # set.


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /