Fixed an issue in the debugger backend causing a crash if a class reimplements __repr__ and a breakpoint is set in the __init__() method of such class.

Thu, 25 Jun 2015 18:58:34 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 25 Jun 2015 18:58:34 +0200
changeset 4293
125a75cfd249
parent 4292
9dfee1559826
child 4295
3ec4679c3dcd

Fixed an issue in the debugger backend causing a crash if a class reimplements __repr__ and a breakpoint is set in the __init__() method of such class.

DebugClients/Python/DebugBase.py file | annotate | diff | comparison | revisions
DebugClients/Python3/DebugBase.py file | annotate | diff | comparison | revisions
--- a/DebugClients/Python/DebugBase.py	Thu Jun 25 18:50:11 2015 +0200
+++ b/DebugClients/Python/DebugBase.py	Thu Jun 25 18:58:34 2015 +0200
@@ -551,8 +551,11 @@
             
                 if ffunc and not ffunc.startswith("<"):
                     argInfo = inspect.getargvalues(fr)
-                    fargs = inspect.formatargvalues(argInfo[0], argInfo[1],
-                                                    argInfo[2], argInfo[3])
+                    try:
+                        fargs = inspect.formatargvalues(argInfo[0], argInfo[1],
+                                                        argInfo[2], argInfo[3])
+                    except Exception:
+                        fargs = ""
                 else:
                     fargs = ""
                 
@@ -609,8 +612,11 @@
                 
                 if ffunc and not ffunc.startswith("<"):
                     argInfo = inspect.getargvalues(fr)
-                    fargs = inspect.formatargvalues(argInfo[0], argInfo[1],
-                                                    argInfo[2], argInfo[3])
+                    try:
+                        fargs = inspect.formatargvalues(argInfo[0], argInfo[1],
+                                                        argInfo[2], argInfo[3])
+                    except Exception:
+                        fargs = ""
                 else:
                     fargs = ""
                 
@@ -709,8 +715,11 @@
                 
                 if ffunc and not ffunc.startswith("<"):
                     argInfo = inspect.getargvalues(fr)
-                    fargs = inspect.formatargvalues(argInfo[0], argInfo[1],
-                                                    argInfo[2], argInfo[3])
+                    try:
+                        fargs = inspect.formatargvalues(argInfo[0], argInfo[1],
+                                                        argInfo[2], argInfo[3])
+                    except Exception:
+                        fargs = ""
                 else:
                     fargs = ""
                 
--- a/DebugClients/Python3/DebugBase.py	Thu Jun 25 18:50:11 2015 +0200
+++ b/DebugClients/Python3/DebugBase.py	Thu Jun 25 18:58:34 2015 +0200
@@ -560,9 +560,12 @@
                 
                 if ffunc and not ffunc.startswith("<"):
                     argInfo = inspect.getargvalues(fr)
-                    fargs = inspect.formatargvalues(
-                        argInfo.args, argInfo.varargs,
-                        argInfo.keywords, argInfo.locals)
+                    try:
+                        fargs = inspect.formatargvalues(
+                            argInfo.args, argInfo.varargs,
+                            argInfo.keywords, argInfo.locals)
+                    except Exception:
+                        fargs = ""
                 else:
                     fargs = ""
                 
@@ -619,9 +622,12 @@
                 
                 if ffunc and not ffunc.startswith("<"):
                     argInfo = inspect.getargvalues(fr)
-                    fargs = inspect.formatargvalues(
-                        argInfo.args, argInfo.varargs,
-                        argInfo.keywords, argInfo.locals)
+                    try:
+                        fargs = inspect.formatargvalues(
+                            argInfo.args, argInfo.varargs,
+                            argInfo.keywords, argInfo.locals)
+                    except Exception:
+                        fargs = ""
                 else:
                     fargs = ""
                 
@@ -723,9 +729,12 @@
                 
                 if ffunc and not ffunc.startswith("<"):
                     argInfo = inspect.getargvalues(fr)
-                    fargs = inspect.formatargvalues(
-                        argInfo.args, argInfo.varargs,
-                        argInfo.keywords, argInfo.locals)
+                    try:
+                        fargs = inspect.formatargvalues(
+                            argInfo.args, argInfo.varargs,
+                            argInfo.keywords, argInfo.locals)
+                    except Exception:
+                        fargs = ""
                 else:
                     fargs = ""
                 

eric ide

mercurial