Commits

eduardo schettino committed eff7799

core. pdb uses post_mortem instead of set_trace to stop in the right place

  • Participants
  • Parent commits acba5db

Comments (0)

Files changed (1)

File avalanche/core.py

 
         if self.debug:
             # get exception traceback
-            detail = ''.join(traceback.format_exception(*sys.exc_info()))
+            exc_info = sys.exc_info()
+            detail = ''.join(traceback.format_exception(*exc_info))
 
             # pdb post-mortem debug is enabled
             if self.debug == 'pdb': # pragma: no cover
                     except:
                         from pdb import Pdb
                     debugger = Pdb(stdin=sys.__stdin__, stdout=sys.__stdout__)
-                    debugger.set_trace(sys._getframe().f_back)
+                    debugger.reset()
+                    debugger.interaction(None, exc_info[2])
 
-                # add link to debug from terminal
+                # add link to activate debuging from terminal
                 url_parts = list(urlparse.urlsplit(request.url))
                 if '__a_debug__' not in url_parts[3]:
                     if url_parts[3]: