From 6c95ac3c95d92d3310e0f38bfcba1e1beb9f7d9f Mon Sep 17 00:00:00 2001 From: mlyko Date: Fri, 24 Feb 2017 21:41:26 +0100 Subject: [PATCH] The loop argument of serve() I suppose that a new loop should be created only if the loop argument is not provided --- sanic/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sanic/server.py b/sanic/server.py index 83bda3fc..fb43e0d7 100644 --- a/sanic/server.py +++ b/sanic/server.py @@ -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)