summaryrefslogtreecommitdiffstats
path: root/python/fatcat_import.py
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2020-03-09 19:06:15 +0100
committerMartin Czygan <martin.czygan@gmail.com>2020-03-09 19:06:15 +0100
commit0ec71d1b47dffe0d976554a76efa636cbe025e08 (patch)
tree9484d55752503289f04eaf09825bba6b1e3b4c61 /python/fatcat_import.py
parent376053a479a8d683fc5e099d0b0b3cb76c026d16 (diff)
downloadfatcat-0ec71d1b47dffe0d976554a76efa636cbe025e08.tar.gz
fatcat-0ec71d1b47dffe0d976554a76efa636cbe025e08.zip
fatcat_import: address potential hanging, if stdin is empty
Diffstat (limited to 'python/fatcat_import.py')
-rwxr-xr-xpython/fatcat_import.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/python/fatcat_import.py b/python/fatcat_import.py
index b0fde01b..bb715fb6 100755
--- a/python/fatcat_import.py
+++ b/python/fatcat_import.py
@@ -47,6 +47,8 @@ def run_arxiv(args):
"fatcat-{}-import-arxiv".format(args.kafka_env),
).run()
else:
+ if args.xml_file == sys.stdin:
+ print('note: reading from stdin', file=sys.stderr)
Bs4XmlFilePusher(ari, args.xml_file, "record").run()
def run_pubmed(args):