summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-08-14 19:30:59 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2015-08-14 19:30:59 (GMT)
commit233983380d1868126918fd86252d6328b0f0ad50 (patch)
tree50f48cac80e83f35ab89016b64e32b2ef7687eb6 /Lib/asyncio
parentac37ba0742b1eb794eca7b6fd95a1ffecc9b6333 (diff)
downloadcpython-233983380d1868126918fd86252d6328b0f0ad50.zip
cpython-233983380d1868126918fd86252d6328b0f0ad50.tar.gz
cpython-233983380d1868126918fd86252d6328b0f0ad50.tar.bz2
Issue #24867: Fix Task.get_stack() for 'async def' coroutines
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/tasks.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py
index 9bfc1cf..a235e74 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: