use SIGINT instead in tests

Conflicts:
	tests/test.py
This commit is contained in:
clowwindy 2014-12-22 17:09:37 +08:00
parent c7b5a5a011
commit 536b7d1ee6
3 changed files with 13 additions and 1 deletions

View file

@ -68,6 +68,11 @@ def main():
tcp_server.close(next_tick=True)
udp_server.close(next_tick=True)
signal.signal(getattr(signal, 'SIGQUIT', signal.SIGTERM), handler)
def int_handler(signum, _):
sys.exit(1)
signal.signal(signal.SIGINT, int_handler)
loop.run()
except (KeyboardInterrupt, IOError, OSError) as e:
logging.error(e)