Use sys.exit(...) instead of exit(...): exit(...) should not be used in programs

This commit is contained in:
practicalswift
2017-07-09 22:57:02 +02:00
parent f088a1bb39
commit 25cd520fc4
10 changed files with 30 additions and 28 deletions

View File

@@ -87,7 +87,7 @@ def get_block_hashes(settings, max_blocks_per_call=10000):
for x,resp_obj in enumerate(reply):
if rpc.response_is_error(resp_obj):
print('JSON-RPC: error at height', height+x, ': ', resp_obj['error'], file=sys.stderr)
exit(1)
sys.exit(1)
assert(resp_obj['id'] == x) # assume replies are in-sequence
if settings['rev_hash_bytes'] == 'true':
resp_obj['result'] = hex_switchEndian(resp_obj['result'])