summaryrefslogtreecommitdiffstats
path: root/python/fatcat_tools/importers/crossref.py
diff options
context:
space:
mode:
authorMartin Czygan <martin@archive.org>2020-07-24 10:11:37 +0000
committerMartin Czygan <martin@archive.org>2020-07-24 10:11:37 +0000
commit8b00843af1366cf019c896057706ace4afff27ba (patch)
tree86fc58bf26f07e272aa27e989f3ab6b4cfef2090 /python/fatcat_tools/importers/crossref.py
parent2170e5ff46dfb2bba9bf26196de3c3774c16cd4a (diff)
parentfc93f35996cab23984d9a45f1a411b8776e437bf (diff)
downloadfatcat-8b00843af1366cf019c896057706ace4afff27ba.tar.gz
fatcat-8b00843af1366cf019c896057706ace4afff27ba.zip
Merge branch 'bnewbold-more-lint-fixes' into 'master'
more lint fixes See merge request webgroup/fatcat!69
Diffstat (limited to 'python/fatcat_tools/importers/crossref.py')
-rw-r--r--python/fatcat_tools/importers/crossref.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/python/fatcat_tools/importers/crossref.py b/python/fatcat_tools/importers/crossref.py
index 854e3d9f..71f08952 100644
--- a/python/fatcat_tools/importers/crossref.py
+++ b/python/fatcat_tools/importers/crossref.py
@@ -278,15 +278,15 @@ class CrossrefImporter(EntityImporter):
# license slug
license_slug = None
license_extra = []
- for l in obj.get('license', []):
- if l['content-version'] not in ('vor', 'unspecified'):
+ for lic in obj.get('license', []):
+ if lic['content-version'] not in ('vor', 'unspecified'):
continue
- slug = lookup_license_slug(l['URL'])
+ slug = lookup_license_slug(lic['URL'])
if slug:
license_slug = slug
- if 'start' in l:
- l['start'] = l['start']['date-time']
- license_extra.append(l)
+ if 'start' in lic:
+ lic['start'] = lic['start']['date-time']
+ license_extra.append(lic)
# references
refs = []
@@ -297,7 +297,7 @@ class CrossrefImporter(EntityImporter):
# NOTE: are there crossref works with year < 100?
if year > 2025 or year < 100:
year = None
- except:
+ except (TypeError, ValueError):
year = None
ref_extra = dict()
key = rm.get('key')