diff options
author | Bryan Newbold <bnewbold@archive.org> | 2019-12-18 14:54:09 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2019-12-18 15:00:27 -0800 |
commit | cbe1af25bdfefd5a6bd9da6014440eaf88ee8e26 (patch) | |
tree | 1c5eec4e34afb8c43975850a1d36ff1841bc0fcf /python/kafka_grobid.py | |
parent | 1a45fe3f3ef3122355f49470fbbcd6dc82c959b2 (diff) | |
download | sandcrawler-cbe1af25bdfefd5a6bd9da6014440eaf88ee8e26.tar.gz sandcrawler-cbe1af25bdfefd5a6bd9da6014440eaf88ee8e26.zip |
refactor: use print(..., file=sys.stderr)
Should use logging soon, but this seems more idiomatic in the meanwhile.
Diffstat (limited to 'python/kafka_grobid.py')
-rwxr-xr-x | python/kafka_grobid.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/python/kafka_grobid.py b/python/kafka_grobid.py index 05e48bd..b0920bc 100755 --- a/python/kafka_grobid.py +++ b/python/kafka_grobid.py @@ -285,10 +285,10 @@ class KafkaGrobidWorker: producer.produce(json.dumps(grobid_output, sort_keys=True).encode('utf-8')) sequential_failures = 0 else: - sys.stderr.write("failed to extract: {}\n".format(status)) + print("failed to extract: {}".format(status), file=sys.stderr) sequential_failures += 1 if sequential_failures > 20: - sys.stderr.write("too many failures in a row, bailing out\n") + print("too many failures in a row, bailing out", file=sys.stderr) sys.exit(-1) |