MCPcopy Create free account
hub / github.com/bterwijn/memory_graph / stack_exception

Function stack_exception

memory_graph/__init__.py:294–301  ·  view source on GitHub ↗

Get the call stack at the point 'exception' was thrown.

(exception, stack_index=0)

Source from the content-addressed store, hash-verified

292 return stack_slice([], end_functions, stack_index+2)
293
294def stack_exception(exception, stack_index=0):
295 """ Get the call stack at the point 'exception' was thrown. """
296 tb = exception.__traceback__
297 frame_infos = []
298 while tb is not None:
299 frame_infos.append(types.SimpleNamespace(frame=tb.tb_frame))
300 tb = tb.tb_next
301 return stack_frames_to_dict(frame_infos[stack_index:])
302
303def stack_pdb(begin_functions=[("trace_dispatch",1)],
304 end_functions=["<module>"],

Callers

nothing calls this directly

Calls 1

stack_frames_to_dictFunction · 0.85

Tested by

no test coverage detected