diff options
Diffstat (limited to 'aergia/aergia.py')
| -rwxr-xr-x | aergia/aergia.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/aergia/aergia.py b/aergia/aergia.py index d8f18ec..83cf0fa 100755 --- a/aergia/aergia.py +++ b/aergia/aergia.py @@ -247,20 +247,15 @@ class Aergia(object): @staticmethod def get_deepest_traceable_frame(coro): - if not coro: - return None curr = coro - lframe = None - while True: + ret = None + while curr: frame = getattr(curr, 'cr_frame', None) - if not frame or not Aergia.should_trace(frame.f_code.co_filename): - return lframe - - lframe = frame - awaited = getattr(curr, 'cr_await', None) - if not awaited or not hasattr(awaited, 'cr_frame'): - return lframe - curr = awaited + # print(frame) + if frame and Aergia.should_trace(frame.f_code.co_filename): + ret = frame + curr = getattr(curr, 'cr_await', None) + return ret @staticmethod def should_trace(filename): |
