Makes the fix robust to the expected future change in bibtexparser

main
Olivier Mangin 6 years ago
parent 3a4acb9fa9
commit 33fc910925
No known key found for this signature in database
GPG Key ID: D72FEC1C3120A884

@ -141,7 +141,8 @@ class EnDecoder(object):
# issue: sciunto-org/python-bibtexparser/#229 is fixed too) # issue: sciunto-org/python-bibtexparser/#229 is fixed too)
if 'editor' in entries[e]: if 'editor' in entries[e]:
entries[e]['editor'] = [ entries[e]['editor'] = [
editor['name'] for editor in entries[e]['editor']] editor['name'] if isinstance(editor, dict) else editor
for editor in entries[e]['editor']]
if len(entries) > 0: if len(entries) > 0:
return entries return entries
else: else:
@ -154,7 +155,6 @@ class EnDecoder(object):
error_msg = 'parsing error: undefined string in provided data: {}'.format(e) error_msg = 'parsing error: undefined string in provided data: {}'.format(e)
raise self.BibDecodingError(error_msg, bibdata) raise self.BibDecodingError(error_msg, bibdata)
@classmethod @classmethod
def _format_parsing_error(cls, e): def _format_parsing_error(cls, e):
"""Transform a pyparsing exception into an error message """Transform a pyparsing exception into an error message

Loading…
Cancel
Save