summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-05-29 15:08:03 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-05-29 15:08:03 -0700
commita73065f7ee22cc02d70d8e144af39954b9c6594a (patch)
tree8d591b50c6c547f41a70b04b73fb54c173340b90 /python
parentca956fc8b686adc3198eff58bbc8e32e13f9ec47 (diff)
downloadfatcat-a73065f7ee22cc02d70d8e144af39954b9c6594a.tar.gz
fatcat-a73065f7ee22cc02d70d8e144af39954b9c6594a.zip
handle empty retraction_of.PMID in pubmed importer
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_tools/importers/pubmed.py6
1 files changed, 4 insertions, 2 deletions
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"