eric6/DebugClients/Python/DebugBase.py

changeset 7903
827d89937c30
parent 7900
72b88fb20261
child 7904
0424ebe2d3b1
diff -r a5248d27c8a9 -r 827d89937c30 eric6/DebugClients/Python/DebugBase.py
--- a/eric6/DebugClients/Python/DebugBase.py	Sun Dec 20 12:35:26 2020 +0100
+++ b/eric6/DebugClients/Python/DebugBase.py	Sun Dec 20 20:13:42 2020 +0100
@@ -449,7 +449,8 @@
             sys.settrace(None)
             sys.setprofile(None)
     
-    def run(self, cmd, globalsDict=None, localsDict=None, debug=True):
+    def run(self, cmd, globalsDict=None, localsDict=None, debug=True,
+            closeSession=True):
         """
         Public method to start a given command under debugger control.
         
@@ -463,6 +464,9 @@
         @type bool
         @return exit code of the program
         @rtype int
+        @param closeSession flag indicating to close the debugger session
+            at exit
+        @type bool
         """
         if globalsDict is None:
             import __main__
@@ -484,13 +488,14 @@
         try:
             exec(cmd, globalsDict, localsDict)      # secok
             atexit._run_exitfuncs()
-            self._dbgClient.progTerminated(0)
+            self._dbgClient.progTerminated(0, closeSession=closeSession)
             exitcode = 0
         except SystemExit:
             atexit._run_exitfuncs()
             excinfo = sys.exc_info()
             exitcode, message = self.__extractSystemExitMessage(excinfo)
-            self._dbgClient.progTerminated(exitcode, message)
+            self._dbgClient.progTerminated(exitcode, message=message,
+                                           closeSession=closeSession)
         except Exception:
             excinfo = sys.exc_info()
             self.user_exception(excinfo, True)

eric ide

mercurial