From 1d1f8d5725ba698d47131ab5bb16b99435ced30e Mon Sep 17 00:00:00 2001 From: Vincent Le Goff Date: Fri, 14 Sep 2018 12:51:50 +0200 Subject: [PATCH] Force evennia.set_trace() to go to the upper frame --- evennia/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/evennia/__init__.py b/evennia/__init__.py index bb9c29a594..01bec176a1 100644 --- a/evennia/__init__.py +++ b/evennia/__init__.py @@ -365,7 +365,9 @@ def set_trace(debugger="auto", term_size=(140, 40)): import pdb dbg = pdb.Pdb(stdout=sys.__stdout__) + # Force the debugger to go up one frame + # (Otherwise, `set_trace` will be placed on this function, not the call) # # stopped at breakpoint. Use 'n' (next) to continue into the code. # - dbg.set_trace() + dbg.set_trace(sys._getframe().f_back)