Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def mount(self):
self._pudb_get_debugger = pudb._get_debugger
pudb._get_debugger = self._get_debugger
def post_mortem(tb, excinfo):
dbg = pudb._get_debugger()
stack, i = dbg.get_stack(None, tb)
dbg.reset()
i = _find_last_non_hidden_frame(stack)
dbg.interaction(stack[i][0], excinfo._excinfo)
def mount(self):
self._pudb_get_debugger = pudb._get_debugger
pudb._get_debugger = self._get_debugger
def unmount(self):
if self._pudb_get_debugger:
pudb._get_debugger = self._pudb_get_debugger
self._pudb_get_debugger = None
def set_trace():
dbg = _get_debugger()
set_interrupt_handler()
dbg.set_trace(sys._getframe().f_back.f_back)
def _interrupt_handler(signum, frame):
from pudb import _get_debugger
_get_debugger().set_trace(frame, as_breakpoint=False)