Commits

Georg Brandl committed 0a3c945

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

Comments (0)

Files changed (1)

sphinx/ext/autodoc.py

                 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' %