fix deprecation warnings

This commit is contained in:
Raphael Deem
2017-01-27 17:59:08 -08:00
parent 3d790a71a0
commit 0eb779185d
2 changed files with 28 additions and 13 deletions

View File

@@ -9,6 +9,7 @@ from signal import SIGTERM, SIGINT
from signal import signal as signal_func
from socket import socket, SOL_SOCKET, SO_REUSEADDR
from time import time
import warnings
from httptools import HttpRequestParser
from httptools.parser.errors import HttpParserError
@@ -384,9 +385,11 @@ def serve_multiple(server_settings, workers, stop_event=None):
:return:
"""
if server_settings.get('loop', None) is not None:
log.warning("Passing a loop will be deprecated in version 0.4.0"
" https://github.com/channelcat/sanic/pull/335"
" has more information.", DeprecationWarning)
if server_settings.get('debug', False):
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)
server_settings['reuse_port'] = True
sock = socket()