Fixed stop at sys.breakpoint() in run mode under Python3 and on first run (Py2 and 3). 5_4_x

Tue, 17 Jun 2014 21:09:24 +0200

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Tue, 17 Jun 2014 21:09:24 +0200
branch
5_4_x
changeset 3641
8cfe4af1af36
parent 3639
5234afd7a6d7
child 3643
a60d2ee42402

Fixed stop at sys.breakpoint() in run mode under Python3 and on first run (Py2 and 3).
(grafted from 2bf828881e86be11e4996264a0e580390ac0cc45)

DebugClients/Python3/DebugBase.py file | annotate | diff | comparison | revisions
DebugClients/Python3/DebugClientBase.py file | annotate | diff | comparison | revisions
Debugger/DebuggerInterfacePython.py file | annotate | diff | comparison | revisions
Debugger/DebuggerInterfacePython3.py file | annotate | diff | comparison | revisions
--- a/DebugClients/Python3/DebugBase.py	Tue Jun 17 19:48:58 2014 +0200
+++ b/DebugClients/Python3/DebugBase.py	Tue Jun 17 21:09:24 2014 +0200
@@ -804,7 +804,7 @@
 
         # Eliminate things like <string> and <stdin>.
         if fn[0] == '<':
-            return 1
+            return True
 
         #XXX - think of a better way to do this.  It's only a convience for
         #debugging the debugger - when the debugger code is in the current
--- a/DebugClients/Python3/DebugClientBase.py	Tue Jun 17 19:48:58 2014 +0200
+++ b/DebugClients/Python3/DebugClientBase.py	Tue Jun 17 21:09:24 2014 +0200
@@ -559,14 +559,15 @@
                 self.debugMod.__dict__['__file__'] = sys.argv[0]
                 sys.modules['__main__'] = self.debugMod
                 res = 0
-                try:
-                    exec(open(sys.argv[0], encoding=self.__coding).read(),
-                         self.debugMod.__dict__)
-                except SystemExit as exc:
-                    res = exc.code
-                    atexit._run_exitfuncs()
-                self.writestream.flush()
-                self.progTerminated(res)
+                code = self.__compileFileSource(self.running)
+                if code:
+                    try:
+                        exec(code, self.debugMod.__dict__)
+                    except SystemExit as exc:
+                        res = exc.code
+                        atexit._run_exitfuncs()
+                    self.writestream.flush()
+                    self.progTerminated(res)
                 return
 
             if cmd == DebugProtocol.RequestProfile:
--- a/Debugger/DebuggerInterfacePython.py	Tue Jun 17 19:48:58 2014 +0200
+++ b/Debugger/DebuggerInterfacePython.py	Tue Jun 17 21:09:24 2014 +0200
@@ -63,7 +63,7 @@
         super().__init__()
         
         self.__isNetworked = True
-        self.__autoContinue = not passive
+        self.__autoContinue = False
         
         self.debugServer = debugServer
         self.passive = passive
--- a/Debugger/DebuggerInterfacePython3.py	Tue Jun 17 19:48:58 2014 +0200
+++ b/Debugger/DebuggerInterfacePython3.py	Tue Jun 17 21:09:24 2014 +0200
@@ -62,7 +62,7 @@
         super().__init__()
         
         self.__isNetworked = True
-        self.__autoContinue = not passive
+        self.__autoContinue = False
         
         self.debugServer = debugServer
         self.passive = passive

eric ide

mercurial