From 7ec5432f6404e05b3b9258a8d52430d6b71a4686 Mon Sep 17 00:00:00 2001 From: Channel Cat Date: Sun, 2 Oct 2016 22:03:14 -0700 Subject: [PATCH] Fixed coroutine checking --- sanic/server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sanic/server.py b/sanic/server.py index ed0b6755..f7ca5225 100644 --- a/sanic/server.py +++ b/sanic/server.py @@ -5,7 +5,7 @@ import signal import functools import httptools import logging -from inspect import iscoroutine +from inspect import isawaitable from ujson import loads as json_loads from urllib.parse import parse_qs from traceback import format_exc @@ -151,7 +151,7 @@ class HttpProtocol(asyncio.Protocol): response = handler(request) # Check if the handler is asynchronous - if iscoroutine(response): + if isawaitable(response): response = await response except Exception as e: