Merge pull request #1391 from AndresSan6/loop_exception

Handle "loop" exception in app.py
This commit is contained in:
Stephen Sadowski 2018-11-05 08:19:01 -06:00 committed by GitHub
commit e3a27c2cc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -835,6 +835,14 @@ class Sanic:
access_log=True,
**kwargs
):
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.