The loop argument of serve()

I suppose that a new loop should be created only if the loop argument is not provided
This commit is contained in:
mlyko 2017-02-24 21:41:26 +01:00 committed by GitHub
parent 435dc72aa1
commit 6c95ac3c95

View File

@ -298,7 +298,7 @@ def serve(host, port, request_handler, error_handler, before_start=None,
:param protocol: subclass of asyncio protocol class
:return: Nothing
"""
if not run_async:
if not loop:
loop = async_loop.new_event_loop()
asyncio.set_event_loop(loop)