Commits

Georg Brandl committed 23d4cf5

#238: In autodoc, catch all errors that occur on module import,
not just ``ImportError``.

Comments (0)

Files changed (2)

 Release 0.6.4 (in development)
 ==============================
 
+* #238: In autodoc, catch all errors that occur on module import,
+  not just ``ImportError``.
+
 * Fix the handling of non-data, but non-method descriptors in autodoc.
 
 * When copying file times, ignore OSErrors raised by ``os.utime()``.

sphinx/ext/autodoc.py

                 obj = self.get_attr(obj, part)
             self.object = obj
             return True
-        except (SyntaxError, ImportError, AttributeError), err:
+        # this used to only catch SyntaxError, ImportError and AttributeError,
+        # but importing modules with side effects can raise all kinds of errors
+        except Exception, err:
             self.directive.warn(
                 'autodoc can\'t import/find %s %r, it reported error: '
                 '"%s", please check your spelling and sys.path' %