Fixed an issue in the new debugger protocol because JSONDecodeError is defined for Python 3.5 and newer only.

Sun, 11 Sep 2016 16:39:30 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 11 Sep 2016 16:39:30 +0200
changeset 5162
bbf2bb2d533c
parent 5161
f7b6ded9cc37
child 5163
741cf2db16ba

Fixed an issue in the new debugger protocol because JSONDecodeError is defined for Python 3.5 and newer only.

DebugClients/Python2/DebugClientBase.py file | annotate | diff | comparison | revisions
DebugClients/Python3/DebugClientBase.py file | annotate | diff | comparison | revisions
DebugClients/Python3/DebugClientThreads.py file | annotate | diff | comparison | revisions
Debugger/DebuggerInterfacePython2.py file | annotate | diff | comparison | revisions
Debugger/DebuggerInterfacePython3.py file | annotate | diff | comparison | revisions
--- a/DebugClients/Python2/DebugClientBase.py	Sun Sep 11 13:11:58 2016 +0200
+++ b/DebugClients/Python2/DebugClientBase.py	Sun Sep 11 16:39:30 2016 +0200
@@ -392,7 +392,7 @@
         
         try:
             commandDict = json.loads(jsonStr.strip())
-        except json.JSONDecodeError as err:
+        except (TypeError, ValueError) as err:
             printerr(str(err))
             return
         
--- a/DebugClients/Python3/DebugClientBase.py	Sun Sep 11 13:11:58 2016 +0200
+++ b/DebugClients/Python3/DebugClientBase.py	Sun Sep 11 16:39:30 2016 +0200
@@ -386,7 +386,7 @@
         
         try:
             commandDict = json.loads(jsonStr.strip())
-        except json.JSONDecodeError as err:
+        except (TypeError, ValueError) as err:
             printerr(str(err))
             return
         
--- a/DebugClients/Python3/DebugClientThreads.py	Sun Sep 11 13:11:58 2016 +0200
+++ b/DebugClients/Python3/DebugClientThreads.py	Sun Sep 11 16:39:30 2016 +0200
@@ -154,7 +154,7 @@
         """
         try:
             self.lockClient()
-            if id is None:
+            if id is None or id not in self.threads:
                 self.currentThread = None
             else:
                 self.currentThread = self.threads[id]
--- a/Debugger/DebuggerInterfacePython2.py	Sun Sep 11 13:11:58 2016 +0200
+++ b/Debugger/DebuggerInterfacePython2.py	Sun Sep 11 16:39:30 2016 +0200
@@ -851,7 +851,7 @@
         
         try:
             commandDict = json.loads(jsonStr.strip())
-        except json.JSONDecodeError as err:
+        except (TypeError, ValueError) as err:
             E5MessageBox.critical(
                 None,
                 self.tr("Debug Protocol Error"),
--- a/Debugger/DebuggerInterfacePython3.py	Sun Sep 11 13:11:58 2016 +0200
+++ b/Debugger/DebuggerInterfacePython3.py	Sun Sep 11 16:39:30 2016 +0200
@@ -851,7 +851,7 @@
         
         try:
             commandDict = json.loads(jsonStr.strip())
-        except json.JSONDecodeError as err:
+        except (TypeError, ValueError) as err:
             E5MessageBox.critical(
                 None,
                 self.tr("Debug Protocol Error"),

eric ide

mercurial