]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
asyncio: Task.__repr__() now also handles CoroWrapper
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 16 Jun 2014 22:26:36 +0000 (00:26 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 16 Jun 2014 22:26:36 +0000 (00:26 +0200)
Lib/asyncio/tasks.py

index e6fd3d380bebe2e8a7b316a5e9e61084d20755f5..281bf608e8770e5883f8b926a4b0b44a3b24c659 100644 (file)
@@ -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)