Skip to content

Commit b493fb9

Browse files
authored
Handle missing dates in PMC records (close #169)
1 parent 1559018 commit b493fb9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pubmed_parser/pubmed_oa_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def parse_pubmed_xml(path, include_path=False, nxml=False):
194194

195195
try:
196196
pub_year = int(pub_date_dict.get("year"))
197-
except TypeError:
197+
except (TypeError, KeyError):
198198
pub_year = None
199199

200200
epub_date = format_date(parse_date(tree, "epub"))

0 commit comments

Comments
 (0)