Improve exception when parsing a Python file fails.

This commit is contained in:
Peter Cock 2017-10-13 13:23:59 +01:00
parent cc89093777
commit 542ca21837

View File

@ -100,7 +100,7 @@ class ModuleAnalyzer(object):
self.tags = parser.definitions self.tags = parser.definitions
self.tagorder = parser.deforders self.tagorder = parser.deforders
except Exception as exc: except Exception as exc:
raise PycodeError('parsing failed: %r' % exc) raise PycodeError('parsing %r failed: %r' % (self.srcname, exc))
def find_attr_docs(self): def find_attr_docs(self):
# type: () -> Dict[Tuple[unicode, unicode], List[unicode]] # type: () -> Dict[Tuple[unicode, unicode], List[unicode]]