[Python-checkins] r66405 - in doctools/branches/0.4.x: CHANGES sphinx/ext/autodoc.py

georg.brandl python-checkins at python.org
Fri Sep 12 17:45:31 CEST 2008


Author: georg.brandl
Date: Fri Sep 12 17:45:31 2008
New Revision: 66405

Log:
Fix for obscure __import__ behavior: if fromlist contains '',
an import of "module." is attempted.


Modified:
   doctools/branches/0.4.x/CHANGES
   doctools/branches/0.4.x/sphinx/ext/autodoc.py

Modified: doctools/branches/0.4.x/CHANGES
==============================================================================
--- doctools/branches/0.4.x/CHANGES	(original)
+++ doctools/branches/0.4.x/CHANGES	Fri Sep 12 17:45:31 2008
@@ -1,6 +1,9 @@
 Release 0.4.3 (in development)
 ==============================
 
+* Fix a bug in autodoc that would import a module twice, once as
+  "module", once as "module.".
+
 * Fix a bug in the HTML writer that created duplicate ``id``
   attributes for section titles with docutils 0.5.
 

Modified: doctools/branches/0.4.x/sphinx/ext/autodoc.py
==============================================================================
--- doctools/branches/0.4.x/sphinx/ext/autodoc.py	(original)
+++ doctools/branches/0.4.x/sphinx/ext/autodoc.py	Fri Sep 12 17:45:31 2008
@@ -176,7 +176,7 @@
     if module in _module_charsets:
         return _module_charsets[module]
     try:
-        filename = __import__(module, None, None, ['']).__file__
+        filename = __import__(module, None, None, ['foo']).__file__
     except (ImportError, AttributeError):
         return None
     if filename[-4:].lower() in ('.pyc', '.pyo'):


More information about the Python-checkins mailing list