diff -r 7a2678e25528 -r 52e96cd0730d eric6/Debugger/VariablesViewer.py --- a/eric6/Debugger/VariablesViewer.py Sun Jul 18 12:23:03 2021 +0200 +++ b/eric6/Debugger/VariablesViewer.py Sun Jul 18 14:28:27 2021 +0200 @@ -211,22 +211,24 @@ dvalue.endswith(("}", ")", "]")) ): # it is most probably a dict, tuple or list derived class - value = ast.literal_eval(dvalue) - valueTypeStr = str(type(value))[8:-2] - if valueTypeStr in VariableItem.arrayTypes: - self.childCount = len(value) - self.hasChildren = True + with contextlib.suppress(Exception): + value = ast.literal_eval(dvalue) + valueTypeStr = str(type(value))[8:-2] + if valueTypeStr in VariableItem.arrayTypes: + self.childCount = len(value) + self.hasChildren = True elif ( (dvalue.endswith("})") and "({" in dvalue) or (dvalue.endswith("])") and "([" in dvalue) ): # that is probably a set derived class - value = ast.literal_eval(dvalue.split("(", 1)[1][:-1]) - valueTypeStr = str(type(value))[8:-2] - if valueTypeStr in VariableItem.arrayTypes: - self.childCount = len(value) - self.hasChildren = True + with contextlib.suppress(Exception): + value = ast.literal_eval(dvalue.split("(", 1)[1][:-1]) + valueTypeStr = str(type(value))[8:-2] + if valueTypeStr in VariableItem.arrayTypes: + self.childCount = len(value) + self.hasChildren = True self.value = dvalue