DebugClients/Python/DebugClientBase.py

branch
6_0_x
changeset 4373
54d6d7c772ea
parent 4120
6f0d4d279aeb
diff -r 5ca53a23d584 -r 54d6d7c772ea DebugClients/Python/DebugClientBase.py
--- a/DebugClients/Python/DebugClientBase.py	Mon Aug 17 12:16:43 2015 +0200
+++ b/DebugClients/Python/DebugClientBase.py	Mon Aug 17 12:31:29 2015 +0200
@@ -578,7 +578,7 @@
                     res = exc.code
                     atexit._run_exitfuncs()
                 self.writestream.flush()
-                self.progTerminated(res)
+                self.progTerminated(res, exit=True)
                 return
 
             if cmd == DebugProtocol.RequestCoverage:
@@ -619,7 +619,7 @@
                 self.cover.stop()
                 self.cover.save()
                 self.writestream.flush()
-                self.progTerminated(res)
+                self.progTerminated(res, exit=True)
                 return
             
             if cmd == DebugProtocol.RequestProfile:
@@ -656,7 +656,7 @@
                     atexit._run_exitfuncs()
                 self.prof.save()
                 self.writestream.flush()
-                self.progTerminated(res)
+                self.progTerminated(res, exit=True)
                 return
 
             if cmd == DebugProtocol.RequestShutdown:
@@ -1243,11 +1243,13 @@
         """
         return self.running
 
-    def progTerminated(self, status):
+    def progTerminated(self, status, exit=False):
         """
         Public method to tell the debugger that the program has terminated.
         
-        @param status the return status
+        @param status return status
+        @param exit flag indicating to perform a sys.exit()
+        @type bool
         """
         if status is None:
             status = 0
@@ -1261,6 +1263,8 @@
             self.set_quit()
             self.running = None
             self.write('%s%d\n' % (DebugProtocol.ResponseExit, status))
+            if exit:
+                sys.exit(status)
         
         # reset coding
         self.__coding = self.defaultCoding

eric ide

mercurial