diff options
author | Peter Cock <p.j.a.cock@googlemail.com> | 2017-10-13 13:23:59 +0100 |
---|---|---|
committer | Peter Cock <p.j.a.cock@googlemail.com> | 2017-10-13 13:23:59 +0100 |
commit | 542ca2183782b4a2c3e712f7f70efc1ec5183ac5 (patch) | |
tree | 071f8fd48a3419895bd5e961286e946e4384fcb0 | |
parent | cc890937770c900828197f7413f9f6188b974ab8 (diff) | |
download | sphinx-git-542ca2183782b4a2c3e712f7f70efc1ec5183ac5.tar.gz |
Improve exception when parsing a Python file fails.
-rw-r--r-- | sphinx/pycode/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sphinx/pycode/__init__.py b/sphinx/pycode/__init__.py index 450ac575b..66544f073 100644 --- a/sphinx/pycode/__init__.py +++ b/sphinx/pycode/__init__.py @@ -100,7 +100,7 @@ class ModuleAnalyzer(object): self.tags = parser.definitions self.tagorder = parser.deforders except Exception as exc: - raise PycodeError('parsing failed: %r' % exc) + raise PycodeError('parsing %r failed: %r' % (self.srcname, exc)) def find_attr_docs(self): # type: () -> Dict[Tuple[unicode, unicode], List[unicode]] |