Commit e3414b6f authored by Julien Muchembled's avatar Julien Muchembled

debug: fix 'app' when using pdb in stress tool

parent c611c48f
...@@ -13,16 +13,20 @@ import sys ...@@ -13,16 +13,20 @@ import sys
def app_set(): def app_set():
try: try:
return sys.modules['neo.lib.threaded_app'].app_set app_set = sys.modules['neo.lib.threaded_app'].app_set
except KeyError: except KeyError:
f = sys._getframe(4) pass
try: else:
while f.f_code.co_name != 'run' or \ if app_set:
f.f_locals.get('self').__class__.__name__ != 'Application': return app_set
f = f.f_back f = sys._getframe(4)
return f.f_locals['self'], try:
except AttributeError: while f.f_code.co_name != 'run' or \
return () f.f_locals.get('self').__class__.__name__ != 'Application':
f = f.f_back
return f.f_locals['self'],
except AttributeError:
return ()
def defer(task): def defer(task):
def wrapper(): def wrapper():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment