Assert was chnaged for an if and updated error messages

This commit is contained in:
Andres Sanchez 2018-10-31 15:23:29 -06:00
parent 7b0af2d80d
commit e63d0091af

View File

@ -835,10 +835,8 @@ class Sanic:
access_log=True,
**kwargs
):
try:
assert "loop" not in kwargs
except AssertionError:
raise TypeError("loop is not a valid argument. For asynchronous support, check https://sanic.readthedocs.io/en/latest/sanic/deploying.html#asynchronous-support")
if "loop" in kwargs:
raise TypeError("loop is not a valid argument. To use an existing loop, change to create_server().\nSee more: https://sanic.readthedocs.io/en/latest/sanic/deploying.html#asynchronous-support")
"""Run the HTTP Server and listen until keyboard interrupt or term
signal. On termination, drain connections before closing.