From 3ddd5ca517225daa38d36a65ff4086c03db5aa15 Mon Sep 17 00:00:00 2001 From: Vincent Le Goff Date: Fri, 14 Sep 2018 12:51:50 +0200 Subject: [PATCH 1/3] 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) From dcc20270e0f38fc441ab177912abbee6f222347d Mon Sep 17 00:00:00 2001 From: Griatch Date: Fri, 14 Sep 2018 22:12:12 +0200 Subject: [PATCH 2/3] Fix lockhandler import error --- evennia/locks/lockhandler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/evennia/locks/lockhandler.py b/evennia/locks/lockhandler.py index 2338b18667..d7170c54d1 100644 --- a/evennia/locks/lockhandler.py +++ b/evennia/locks/lockhandler.py @@ -664,9 +664,9 @@ def validate_lockstring(lockstring): if no error was found. """ - global _LOCKHANDLER - if not _LOCKHANDLER: - _LOCKHANDLER = LockHandler(_ObjDummy()) + global _LOCK_HANDLER + if not _LOCK_HANDLER: + _LOCK_HANDLER = LockHandler(_ObjDummy()) return _LOCK_HANDLER.validate(lockstring) From 7b4f6716d253082d25af5d2814cc535af681784c Mon Sep 17 00:00:00 2001 From: Griatch Date: Fri, 14 Sep 2018 22:24:53 +0200 Subject: [PATCH 3/3] Minor refinement of code comment --- evennia/__init__.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/evennia/__init__.py b/evennia/__init__.py index 01bec176a1..6858744d42 100644 --- a/evennia/__init__.py +++ b/evennia/__init__.py @@ -365,9 +365,6 @@ 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. - # + # Start debugger, forcing it up one stack frame (otherwise `set_trace` will start # debugger at + # this point, not the actual code location) dbg.set_trace(sys._getframe().f_back)