Fixed issues formatting the exit value in the debugger backends.

Sat, 03 Dec 2011 12:28:34 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 03 Dec 2011 12:28:34 +0100
changeset 1475
7e5348c83c9d
parent 1474
1eaec11a0078
child 1481
eebaadaee21e

Fixed issues formatting the exit value in the debugger backends.

DebugClients/Python/DebugBase.py file | annotate | diff | comparison | revisions
DebugClients/Python3/DebugBase.py file | annotate | diff | comparison | revisions
--- a/DebugClients/Python/DebugBase.py	Mon Nov 28 20:03:49 2011 +0100
+++ b/DebugClients/Python/DebugBase.py	Sat Dec 03 12:28:34 2011 +0100
@@ -583,6 +583,11 @@
         """
         if exctype in [SystemExit, bdb.BdbQuit]:
             atexit._run_exitfuncs()
+            if excval is None:
+                excval = 0
+            elif isinstance(excval, (unicode, str)):
+                self._dbgClient.write(excval)
+                excval = 1
             if isinstance(excval, int):
                 self._dbgClient.progTerminated(excval)
             else:
--- a/DebugClients/Python3/DebugBase.py	Mon Nov 28 20:03:49 2011 +0100
+++ b/DebugClients/Python3/DebugBase.py	Sat Dec 03 12:28:34 2011 +0100
@@ -591,6 +591,14 @@
         exctype, excval, exctb = excinfo
         if exctype in [SystemExit, bdb.BdbQuit]:
             atexit._run_exitfuncs()
+            if excval is None:
+                excval = 0
+            elif isinstance(excval, str):
+                self._dbgClient.write(excval)
+                excval = 1
+            elif isinstance(excval, bytes):
+                self._dbgClient.write(excval.decode())
+                excval = 1
             if isinstance(excval, int):
                 self._dbgClient.progTerminated(excval)
             else:

eric ide

mercurial