fix async run

This commit is contained in:
Raphael Deem 2017-01-28 15:26:44 -08:00
parent 7257e5794f
commit a1ee8f076e

View File

@ -297,8 +297,8 @@ def serve(host, port, request_handler, error_handler, before_start=None,
:param protocol: Subclass of asyncio protocol class :param protocol: Subclass of asyncio protocol class
:return: Nothing :return: Nothing
""" """
loop = async_loop.new_event_loop() loop = asyncio.get_event_loop()
asyncio.set_event_loop(loop) asyncio.set_event_loop_policy(async_loop.EventLoopPolicy())
if debug: if debug:
loop.set_debug(debug) loop.set_debug(debug)