MCPcopy Create free account
hub / github.com/SimHacker/micropolis / debug

Function debug

turbogears/micropolis/controllers.py:297–307  ·  view source on GitHub ↗

Interrupt running process, and provide a python prompt for interactive debugging.

(sig, frame)

Source from the content-addressed store, hash-verified

295# Getting stack trace from a running Python application
296# http://stackoverflow.com/questions/132058/getting-stack-trace-from-a-running-python-application
297def debug(sig, frame):
298 """Interrupt running process, and provide a python prompt for
299 interactive debugging."""
300 d={'_frame':frame} # Allow access to frame object.
301 d.update(frame.f_globals) # Unless shadowed by global
302 d.update(frame.f_locals)
303
304 i = code.InteractiveConsole(d)
305 message = "Signal recieved : entering python shell.\nTraceback:\n"
306 message += ''.join(traceback.format_stack(frame))
307 i.interact(message)
308
309
310def listen():

Callers

nothing calls this directly

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected