remove error message for Ctrl+C

This commit is contained in:
Yann Collet 2018-08-13 11:48:25 -07:00
parent f3aa510738
commit e11f91b039

View File

@ -23,8 +23,11 @@ rate *= 1.4 # compensation for excluding i/o time (experimentally determined)
start = time.time()
total_read = 0
buf = " "
while len(buf):
sys.stderr.close() # remove error message, for Ctrl+C
try:
buf = " "
while len(buf):
now = time.time()
to_read = max(int(rate * (now - start) - total_read), 1)
max_buf_size = 1 * MB
@ -40,3 +43,6 @@ while len(buf):
wait_time = max(read_end - read_start, write_end - write_start)
start += wait_time # exclude delay of the slowest
total_read += len(buf)
except (KeyboardInterrupt, BrokenPipeError) as e:
pass