Handle loop exception in app.py

This commit is contained in:
Andres Sanchez 2018-10-31 13:35:03 -06:00
parent 7d79a86d4d
commit 7b0af2d80d

View File

@ -835,6 +835,11 @@ 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")
"""Run the HTTP Server and listen until keyboard interrupt or term
signal. On termination, drain connections before closing.