Import can raise SyntaxError as well, e.g. for invalid encodings.

This commit is contained in:
Georg Brandl
2009-06-16 19:31:44 +02:00
parent 4330626713
commit 3e820a6f47

View File

@@ -330,7 +330,7 @@ class Documenter(object):
obj = self.get_attr(obj, part)
self.object = obj
return True
except (ImportError, AttributeError), err:
except (SyntaxError, ImportError, AttributeError), err:
self.directive.warn(
'autodoc can\'t import/find %s %r, it reported error: '
'"%s", please check your spelling and sys.path' %