diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py index e6fd3d380be..281bf608e87 100644 --- a/Lib/asyncio/tasks.py +++ b/Lib/asyncio/tasks.py @@ -190,7 +190,7 @@ class Task(futures.Future): i = len(res) text = self._coro.__name__ coro = self._coro - if inspect.isgenerator(coro): + if iscoroutine(coro): filename = coro.gi_code.co_filename if coro.gi_frame is not None: text += ' at %s:%s' % (filename, coro.gi_frame.f_lineno)