Skip to content

Commit

Permalink
Catch ET.ParseError so we see what file
Browse files Browse the repository at this point in the history
  • Loading branch information
plebln committed Mar 26, 2018
1 parent 469c795 commit b2388b8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion xml2bib.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ def __str__(self):

class XMLReader():
def __init__(self, filename):
tree = ET.parse(filename)
try:
tree = ET.parse(filename)
except ET.ParseError:
print('ParseError while processing', filename, file=sys.stderr)
raise
self.root = tree.getroot()


Expand Down

0 comments on commit b2388b8

Please sign in to comment.