Fixed issues formatting the exit value in the debugger backends. 5_1_x

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

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 03 Dec 2011 12:28:34 +0100
branch
5_1_x
changeset 1476
7d7710aeeab9
parent 1473
c3bdd5ebafbc
child 1477
5545a3129010

Fixed issues formatting the exit value in the debugger backends.
(transplanted from 7e5348c83c9d3a677ed60f18e4686f602e723194)

DebugClients/Python/DebugBase.py file | annotate | diff | comparison | revisions
DebugClients/Python3/DebugBase.py file | annotate | diff | comparison | revisions
--- a/DebugClients/Python/DebugBase.py	Sun Nov 27 19:38:09 2011 +0100
+++ b/DebugClients/Python/DebugBase.py	Sat Dec 03 12:28:34 2011 +0100
@@ -579,6 +579,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	Sun Nov 27 19:38:09 2011 +0100
+++ b/DebugClients/Python3/DebugBase.py	Sat Dec 03 12:28:34 2011 +0100
@@ -587,6 +587,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