From a1ee8f076e984b67d29c6f9fbc74f9416b294874 Mon Sep 17 00:00:00 2001 From: Raphael Deem Date: Sat, 28 Jan 2017 15:26:44 -0800 Subject: [PATCH] fix async run --- sanic/server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sanic/server.py b/sanic/server.py index 48c3827e..be9bc31c 100644 --- a/sanic/server.py +++ b/sanic/server.py @@ -297,8 +297,8 @@ def serve(host, port, request_handler, error_handler, before_start=None, :param protocol: Subclass of asyncio protocol class :return: Nothing """ - loop = async_loop.new_event_loop() - asyncio.set_event_loop(loop) + loop = asyncio.get_event_loop() + asyncio.set_event_loop_policy(async_loop.EventLoopPolicy()) if debug: loop.set_debug(debug)