def _wdb_execute(self, transforms): from wdb import trace, Wdb if Wdb.enabled: with trace(close_on_exit=True, below=True): old_execute(self, transforms) else: old_execute(self, transforms) # Close set_trace debuggers stop_trace(close_on_exit=True)
def _wdb_execute(*args, **kwargs): from wdb import trace, Wdb if Wdb.enabled: with trace(close_on_exit=True, below=below, under=under): old_execute(*args, **kwargs) else: old_execute(*args, **kwargs) # Close set_trace debuggers stop_trace(close_on_exit=True)
def catch(environ, start_response): appiter = None try: appiter = self.app(environ, start_response) for item in appiter: yield item except Exception: start_response('500 INTERNAL SERVER ERROR', [ ('Content-Type', 'text/html')]) yield _handle_off(self.theme) finally: # Close set_trace debuggers stop_trace(close_on_exit=True) hasattr(appiter, 'close') and appiter.close()
def catch(environ, start_response): appiter = None try: appiter = self.app(environ, start_response) for item in appiter: yield item except Exception: start_response('500 INTERNAL SERVER ERROR', [('Content-Type', 'text/html')]) yield _handle_off() finally: # Close set_trace debuggers stop_trace(close_on_exit=True) hasattr(appiter, 'close') and appiter.close()
def _wdb_execute(*args, **kwargs): from wdb import trace, Wdb interesting = True if len(args) > 0 and isinstance(args[0], ErrorHandler): interesting = False elif len(args) > 2 and isinstance( args[0], StaticFileHandler) and args[2] == 'favicon.ico': interesting = False if Wdb.enabled and interesting: with trace(close_on_exit=True, under=under): old_execute(*args, **kwargs) else: old_execute(*args, **kwargs) # Close set_trace debuggers stop_trace(close_on_exit=True)
def _wdb_execute(*args, **kwargs): from wdb import trace, Wdb wdb = Wdb.get() wdb.closed = False # Activate request ignores interesting = True if len(args) > 0 and isinstance(args[0], ErrorHandler): interesting = False elif len(args) > 2 and isinstance( args[0], StaticFileHandler) and args[2] == 'favicon.ico': interesting = False if Wdb.enabled and interesting: with trace(close_on_exit=True, under=under): old_execute(*args, **kwargs) else: old_execute(*args, **kwargs) # Close set_trace debuggers stop_trace(close_on_exit=True) # Reset closed state wdb.closed = False
import wdb def divide_by_zero(z): return z / 0 def with_trace_fun(): a = 2 b = 4 c = a + b print(c) d = divide_by_zero(c) print(d) print('The end') wdb.start_trace() try: with_trace_fun() finally: wdb.stop_trace()
def stop(self): stop_trace(sys._getframe().f_back)
import wdb def divide_by_zero(z): return z / 0 def with_trace_fun(): a = 2 b = 4 c = a + b print(c) try: d = divide_by_zero(c) except ZeroDivisionError: d = -1 print(d) print('The end') wdb.start_trace(full=True) with_trace_fun() wdb.stop_trace()