Issue #24867: Fix Task.get_stack() for 'async def' coroutines

This commit is contained in:
Yury Selivanov 2015-08-14 15:30:59 -04:00
parent ac37ba0742
commit 233983380d
2 changed files with 37 additions and 1 deletions

View file

@ -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: