#238: In autodoc, catch all errors that occur on module import,

not just ``ImportError``.
This commit is contained in:
Georg Brandl 2009-11-08 22:37:29 +01:00
parent 598f2dda3a
commit b9253e348b
2 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,9 @@
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()``.

View File

@ -322,7 +322,9 @@ class Documenter(object):
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' %