Package list python-procrunner / f5ce8be
catch BrokenPipeErrors on Windows Markus Gerstel 1 year, 4 months ago
1 changed file(s) with 16 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
499499 # send terminate signal and wait some time for buffers to be read
500500 p.terminate()
501501 if thread_pipe_pool:
502 thread_pipe_pool[0].poll(0.5)
502 try:
503 thread_pipe_pool[0].poll(0.5)
504 except BrokenPipeError as e:
505 # on Windows this raises "BrokenPipeError: [Errno 109] The pipe has been ended"
506 # which is for all intents and purposes equivalent to a True return value.
507 if e.winerror != 109:
508 raise
509 thread_pipe_pool.pop(0)
503510 if not stdout.has_finished() or not stderr.has_finished():
504511 time.sleep(2)
505512 p.poll()
509516 # send kill signal and wait some more time for buffers to be read
510517 p.kill()
511518 if thread_pipe_pool:
512 thread_pipe_pool[0].poll(0.5)
519 try:
520 thread_pipe_pool[0].poll(0.5)
521 except BrokenPipeError as e:
522 # on Windows this raises "BrokenPipeError: [Errno 109] The pipe has been ended"
523 # which is for all intents and purposes equivalent to a True return value.
524 if e.winerror != 109:
525 raise
526 thread_pipe_pool.pop(0)
513527 if not stdout.has_finished() or not stderr.has_finished():
514528 time.sleep(5)
515529 p.poll()