From 233983380d1868126918fd86252d6328b0f0ad50 Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Fri, 14 Aug 2015 15:30:59 -0400 Subject: Issue #24867: Fix Task.get_stack() for 'async def' coroutines --- Lib/asyncio/tasks.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Lib/asyncio/tasks.py') diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py index 9bfc1cf814..a235e742e2 100644 --- a/Lib/asyncio/tasks.py +++ b/Lib/asyncio/tasks.py @@ -128,7 +128,11 @@ class Task(futures.Future): returned for a suspended coroutine. """ frames = [] - f = self._coro.gi_frame + try: + # 'async def' coroutines + f = self._coro.cr_frame + except AttributeError: + f = self._coro.gi_frame if f is not None: while f is not None: if limit is not None: -- cgit v1.2.1