From e63d0091afc917506c3acb1dfc99c4245dc01019 Mon Sep 17 00:00:00 2001 From: Andres Sanchez Date: Wed, 31 Oct 2018 15:23:29 -0600 Subject: [PATCH] Assert was chnaged for an if and updated error messages --- sanic/app.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sanic/app.py b/sanic/app.py index 477fb6d6..500a6d45 100644 --- a/sanic/app.py +++ b/sanic/app.py @@ -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.