Merge pull request #390 from chenfengyuan/pass_loop_warning
fix always warning loop is passed issue
This commit is contained in:
commit
d6b386083f
|
@ -360,18 +360,18 @@ class Sanic:
|
||||||
Helper function used by `run` and `create_server`.
|
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 loop is not None:
|
||||||
if self.debug:
|
if debug:
|
||||||
warnings.simplefilter('default')
|
warnings.simplefilter('default')
|
||||||
warnings.warn("Passing a loop will be deprecated in version"
|
warnings.warn("Passing a loop will be deprecated in version"
|
||||||
" 0.4.0 https://github.com/channelcat/sanic/"
|
" 0.4.0 https://github.com/channelcat/sanic/"
|
||||||
"pull/335 has more information.",
|
"pull/335 has more information.",
|
||||||
DeprecationWarning)
|
DeprecationWarning)
|
||||||
|
|
||||||
|
self.error_handler.debug = debug
|
||||||
|
self.debug = debug
|
||||||
|
self.loop = loop = get_event_loop()
|
||||||
|
|
||||||
server_settings = {
|
server_settings = {
|
||||||
'protocol': protocol,
|
'protocol': protocol,
|
||||||
'host': host,
|
'host': host,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user