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

georg.brandl python-checkins at python.org
Fri Jul 18 23:06:50 CEST 2008


Author: georg.brandl
Date: Fri Jul 18 23:06:42 2008
New Revision: 65119

Log:
Emit a more precise error message in autodoc.


Modified:
   doctools/branches/0.4.x/CHANGES
   doctools/branches/0.4.x/TODO
   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 Jul 18 23:06:42 2008
@@ -1,6 +1,9 @@
 Release 0.4.2 (in development)
 ==============================
 
+* autodoc now emits a more precise error message when a module
+  can't be imported or an attribute can't be found.
+
 * The JavaScript search now uses the correct file name suffix when
   referring to found items.
 

Modified: doctools/branches/0.4.x/TODO
==============================================================================
--- doctools/branches/0.4.x/TODO	(original)
+++ doctools/branches/0.4.x/TODO	Fri Jul 18 23:06:42 2008
@@ -1,6 +1,7 @@
 Sphinx TODO
 ===========
 
+- verbose option
 - remove redundant <ul>s in tocs
 - autoattribute in autodoc
 - range and object options for literalinclude

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 Jul 18 23:06:42 2008
@@ -344,10 +344,11 @@
             modfile = None  # e.g. for builtin and C modules
         for part in objpath:
             todoc = getattr(todoc, part)
-    except (ImportError, AttributeError):
+    except (ImportError, AttributeError), err:
         warnings.append(document.reporter.warning(
-            'autodoc can\'t import/find %s %r, check your spelling '
-            'and sys.path' % (what, str(fullname)), line=lineno))
+            'autodoc can\'t import/find %s %r, it reported error: "%s",'
+            'please check your spelling and sys.path' %
+            (what, str(fullname), err), line=lineno))
         return warnings, result
 
     # check __module__ of object if wanted (for members not given explicitly)


More information about the Python-checkins mailing list