DebugClients/Python/DebugBase.py

branch
debugger fine grinding
changeset 5540
40992b7a60a9
parent 5539
05b365ba9f55
child 5543
4e2ab5215bcf
--- a/DebugClients/Python/DebugBase.py	Sat Feb 18 21:54:09 2017 +0100
+++ b/DebugClients/Python/DebugBase.py	Sun Feb 19 22:13:48 2017 +0100
@@ -428,7 +428,7 @@
             sys.settrace(None)
             sys.setprofile(None)
     
-    def run(self, cmd, globals=None, locals=None):
+    def run(self, cmd, globals=None, locals=None, debug=True):
         """
         Public method to start a given command under debugger control.
         
@@ -446,10 +446,12 @@
         if locals is None:
             locals = globals
         
-        sys.settrace(self.trace_dispatch)
         if not isinstance(cmd, types.CodeType):
             cmd = compile(cmd, "<string>", "exec")
         
+        if debug:
+            sys.settrace(self.trace_dispatch)
+        
         try:
             exec(cmd, globals, locals)
             atexit._run_exitfuncs()

eric ide

mercurial