aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_tools/importers/crossref.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-11-03 13:57:18 -0700
committerBryan Newbold <bnewbold@robocracy.org>2021-11-03 16:46:07 -0700
commit5d29d1336afc90d3575a0379a9e9d9bdac8d1856 (patch)
treec22755cdf2615453ab1f3b7ddaf13becd946a63d /python/fatcat_tools/importers/crossref.py
parentcaf1cb316ed18820f3239a285ef14bf45ef963a2 (diff)
downloadfatcat-5d29d1336afc90d3575a0379a9e9d9bdac8d1856.tar.gz
fatcat-5d29d1336afc90d3575a0379a9e9d9bdac8d1856.zip
typing: relatively simple type check fixes
These mostly add new variable names so that existing variables aren't overwritten with a new type; delay coercing '{}' or '[]' to 'None' until the last minute; adding is-not-None checks to conditional clauses; and similar small changes.
Diffstat (limited to 'python/fatcat_tools/importers/crossref.py')
-rw-r--r--python/fatcat_tools/importers/crossref.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/python/fatcat_tools/importers/crossref.py b/python/fatcat_tools/importers/crossref.py
index 689989d2..816f6ab6 100644
--- a/python/fatcat_tools/importers/crossref.py
+++ b/python/fatcat_tools/importers/crossref.py
@@ -279,8 +279,6 @@ class CrossrefImporter(EntityImporter):
]
if am.get("sequence") and am.get("sequence") != "additional":
extra["seq"] = clean(am.get("sequence"))
- if not extra:
- extra = None
assert ctype in ("author", "editor", "translator")
raw_name = clean(raw_name)
contribs.append(
@@ -292,7 +290,7 @@ class CrossrefImporter(EntityImporter):
surname=clean(am.get("family")),
raw_affiliation=clean(raw_affiliation),
role=ctype,
- extra=extra,
+ extra=extra or None,
)
)
return contribs