Fixed an issue in DebugClientBase.py causing a simple 'raise' statement in a script to be debugged to fail with Python 2. maintenance

Fri, 03 Nov 2017 17:10:01 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 03 Nov 2017 17:10:01 +0100
branch
maintenance
changeset 5980
25b57b1621f5
parent 5979
82adf5340eb0
child 5981
2f2c988c359e

Fixed an issue in DebugClientBase.py causing a simple 'raise' statement in a script to be debugged to fail with Python 2.
(grafted from 0c10d2701adb15233495aa1acf7d5e7aefa31e1d)

DebugClients/Python/DebugClientBase.py file | annotate | diff | comparison | revisions
--- a/DebugClients/Python/DebugClientBase.py	Fri Nov 03 16:14:08 2017 +0100
+++ b/DebugClients/Python/DebugClientBase.py	Fri Nov 03 17:10:01 2017 +0100
@@ -2034,16 +2034,25 @@
             if sys.argv[1] == '--no-encoding':
                 self.noencoding = True
                 del sys.argv[1]
+            
             if sys.argv[1] == '':
                 del sys.argv[1]
+            
             try:
                 port = int(sys.argv[1])
             except (ValueError, IndexError):
                 port = -1
-            try:
-                redirect = int(sys.argv[2])
-            except (ValueError, IndexError):
+            
+            if sys.argv[2] == "True":
                 redirect = True
+            elif sys.argv[2] == "False":
+                redirect = False
+            else: 
+                try:
+                    redirect = int(sys.argv[2])
+                except (ValueError, IndexError):
+                    redirect = True
+            
             try:
                 ipOrHost = sys.argv[3]
                 if ':' in ipOrHost:
@@ -2054,9 +2063,11 @@
                     remoteAddress = self.__resolveHost(ipOrHost)
             except Exception:
                 remoteAddress = None
+            
             sys.argv = ['']
             if '' not in sys.path:
                 sys.path.insert(0, '')
+            
             if port >= 0:
                 if not self.noencoding:
                     self.__coding = self.defaultCoding

eric ide

mercurial