eric6/DebugClients/Python/DebugBase.py

branch
multi_processing
changeset 7421
4a9900aef04e
parent 7405
bf6be3cff6cf
child 7563
b0d6b63f2843
diff -r 0d596bb4a60d -r 4a9900aef04e eric6/DebugClients/Python/DebugBase.py
--- a/eric6/DebugClients/Python/DebugBase.py	Sun Feb 16 12:42:12 2020 +0100
+++ b/eric6/DebugClients/Python/DebugBase.py	Sun Feb 16 16:14:25 2020 +0100
@@ -434,12 +434,14 @@
         
         @param cmd command / code to execute under debugger control
         @type str or CodeType
-        @keyparam globalsDict dictionary of global variables for cmd
+        @param globalsDict dictionary of global variables for cmd
+        @type dict
+        @param localsDict dictionary of local variables for cmd
         @type dict
-        @keyparam localsDict dictionary of local variables for cmd
-        @type dict
-        @keyparam debug flag if command should run under debugger control
+        @param debug flag if command should run under debugger control
         @type bool
+        @return exit code of the program
+        @rtype int
         """
         if globalsDict is None:
             import __main__
@@ -462,6 +464,7 @@
             exec(cmd, globalsDict, localsDict)
             atexit._run_exitfuncs()
             self._dbgClient.progTerminated(0)
+            exitcode = 0
         except SystemExit:
             atexit._run_exitfuncs()
             excinfo = sys.exc_info()
@@ -470,9 +473,11 @@
         except Exception:
             excinfo = sys.exc_info()
             self.user_exception(excinfo, True)
+            exitcode = 242
         finally:
             self.quitting = True
             sys.settrace(None)
+        return exitcode
 
     def _set_stopinfo(self, stopframe, returnframe):
         """
@@ -981,6 +986,9 @@
             elif isinstance(code, int):
                 exitcode = code
                 message = ""
+            elif code is None:
+                exitcode = 0
+                message = ""
             else:
                 exitcode = 1
                 message = str(code)

eric ide

mercurial