diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2020-03-09 19:06:15 +0100 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2020-03-09 19:06:15 +0100 |
commit | 0ec71d1b47dffe0d976554a76efa636cbe025e08 (patch) | |
tree | 9484d55752503289f04eaf09825bba6b1e3b4c61 /python/fatcat_import.py | |
parent | 376053a479a8d683fc5e099d0b0b3cb76c026d16 (diff) | |
download | fatcat-0ec71d1b47dffe0d976554a76efa636cbe025e08.tar.gz fatcat-0ec71d1b47dffe0d976554a76efa636cbe025e08.zip |
fatcat_import: address potential hanging, if stdin is empty
Diffstat (limited to 'python/fatcat_import.py')
-rwxr-xr-x | python/fatcat_import.py | 2 |
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): |