From aa547859186760e933780fb9f76a2405a2b9b8f4 Mon Sep 17 00:00:00 2001 From: Fengyuan Chen Date: Sat, 4 Feb 2017 15:54:37 +0800 Subject: [PATCH] fix always warning loop is passed issue --- sanic/sanic.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sanic/sanic.py b/sanic/sanic.py index 2d2f83fe..a6a65204 100644 --- a/sanic/sanic.py +++ b/sanic/sanic.py @@ -445,18 +445,18 @@ class Sanic: Helper function used by `run` and `create_server`. """ - self.error_handler.debug = debug - self.debug = debug - self.loop = loop = get_event_loop() - if loop is not None: - if self.debug: + if debug: warnings.simplefilter('default') warnings.warn("Passing a loop will be deprecated in version" " 0.4.0 https://github.com/channelcat/sanic/" "pull/335 has more information.", DeprecationWarning) + self.error_handler.debug = debug + self.debug = debug + self.loop = loop = get_event_loop() + server_settings = { 'protocol': protocol, 'host': host,