Message79818
I tried to remove the frame from the traceback type (to keep only the
filename and code name), but many functions rely on the frame object.
Some examples:
Lib/unittest.py:
class TestResult(object):
def _is_relevant_tb_level(self, tb):
return '__unittest' in tb.tb_frame.f_globals
Lib/traceback.py:
print_tb() uses tb.tb_frame.f_globals for linecache.getline()
Doc/tools/jinga/debugger.py:
translate_exception() checks if __jinja_template__ variable is
present in b.tb_frame.f_globals
Lib/idlelib/StackViewer.py:
StackTreeItem.get_stack() stores each tb.tb_frame in a list
FrameTreeItem.GetText() reads frame.f_globals["__name__"] and gets
the filename and code name using frame.f_code
Lib/logging/__init__.py:
currentframe() reads sys.exc_traceback.tb_frame.f_back
Lib/types.py:
Use tb.tb_frame to create the FrameType
(...)
co_name/co_filename can be stored directly in the traceback. But what
about tb.tb_frame.f_back and tb.tb_frame.f_globals? I'm not motivated
enough to change traceback API. |
|
Date |
User |
Action |
Args |
2009-01-14 01:09:24 | vstinner | set | recipients:
+ vstinner, tim.peters, loewis, akuchling, ghazel |
2009-01-14 01:09:23 | vstinner | set | messageid: <1231895363.78.0.128452246045.issue1565525@psf.upfronthosting.co.za> |
2009-01-14 01:09:22 | vstinner | link | issue1565525 messages |
2009-01-14 01:09:20 | vstinner | create | |
|