From a73065f7ee22cc02d70d8e144af39954b9c6594a Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 29 May 2019 15:08:03 -0700 Subject: handle empty retraction_of.PMID in pubmed importer --- python/fatcat_tools/importers/pubmed.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'python/fatcat_tools') diff --git a/python/fatcat_tools/importers/pubmed.py b/python/fatcat_tools/importers/pubmed.py index 1246bf6b..9a9849ed 100644 --- a/python/fatcat_tools/importers/pubmed.py +++ b/python/fatcat_tools/importers/pubmed.py @@ -401,8 +401,10 @@ class PubmedImporter(EntityImporter): release_type = "retraction" retraction_of = medline.find("CommentsCorrections", RefType="RetractionOf") if retraction_of: - extra_pubmed['retraction_of_raw'] = retraction_of.RefSource.string - extra_pubmed['retraction_of_pmid'] = retraction_of.PMID.string + if retraction_of.RefSource: + extra_pubmed['retraction_of_raw'] = retraction_of.RefSource.string + if retraction_of.PMID: + extra_pubmed['retraction_of_pmid'] = retraction_of.PMID.string # everything in medline is published release_stage = "published" -- cgit v1.2.3