diff options
Diffstat (limited to 'aergia/aergia.py')
| -rwxr-xr-x | aergia/aergia.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/aergia/aergia.py b/aergia/aergia.py index b99f06d..efc68e2 100755 --- a/aergia/aergia.py +++ b/aergia/aergia.py @@ -54,6 +54,8 @@ import threading import time import traceback +import pprint + orig_thread_join = threading.Thread.join @@ -205,7 +207,6 @@ class Aergia(object): if isinstance(loop, asyncio.AbstractEventLoop): return loop else: - # print(frame.f_code.co_name) frame = frame.f_back return None @@ -271,8 +272,16 @@ class Aergia(object): idle = [] current = asyncio.current_task(loop) for task in asyncio.all_tasks(loop): + # the task is not idle if task == current: continue + # the task hasn't even run yet + # assumes that all started tasks are sitting at an await + # statement. + # if this isn't the case, the associated coroutine will + # be 'waiting' on the coroutine declaration. No! Bad! + if getattr(task.get_coro(), 'cr_await', None) is None: + continue coro = task.get_coro() if coro: f = Aergia._get_deepest_traceable_frame(coro) |
