Skip to content
Myr

Avoid server from blocking if an exception is found in the main thread

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Braulio Valdivielso Martínez · committed by Braulio Valdivielso Martínez · parent aac32ac · Browse files · 1 file+5 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−0 removed

  • other:+5 added−0 removed

1 file+5 added−0 removed

modified:testserver/server.py+5 added
67 unmodified lines
68 69 def __exit__(self, exc_type, exc_value, traceback):70 if exc_type is None:71 self.stop_event.wait()72 else:73 if self.wait_to_close_event:74 # avoid server from blocking if an exception is found75 # in the main thread76 self.wait_to_close_event.set() 77 return False # allow exceptions to propagate 78