diff -r 632257ad7337 -r 9db0b0f15d12 DebugClients/Python2/DebugClientBase.py --- a/DebugClients/Python2/DebugClientBase.py Fri Sep 16 19:34:58 2016 +0200 +++ b/DebugClients/Python2/DebugClientBase.py Mon Sep 19 20:10:33 2016 +0200 @@ -1442,18 +1442,21 @@ DebugVariables.getType(variable) if resolver: variable = resolver.resolve(variable, attribute) + if variable is None: + break else: break - typeObject, typeName, typeStr, resolver = \ - DebugVariables.getType(variable) - if typeStr.startswith(("PyQt5.", "PyQt4.")): - vlist = self.__formatQtVariable(variable, typeName) - varlist.extend(vlist) - elif resolver: - dict = resolver.getDictionary(variable) - vlist = self.__formatVariablesList( - list(dict.keys()), dict, scope, filter) - varlist.extend(vlist) + if variable is not None: + typeObject, typeName, typeStr, resolver = \ + DebugVariables.getType(variable) + if typeStr.startswith(("PyQt5.", "PyQt4.")): + vlist = self.__formatQtVariable(variable, typeName) + varlist.extend(vlist) + elif resolver: + dict = resolver.getDictionary(variable) + vlist = self.__formatVariablesList( + list(dict.keys()), dict, scope, filter) + varlist.extend(vlist) self.sendJsonCommand("ResponseVariable", { "scope": scope, @@ -1664,21 +1667,21 @@ else: value = dict[key] valtypestr = ("%s" % type(value))[1:-1] + valtypename = type(value).__name__ - if valtypestr.split(' ', 1)[0] == 'class': + if valtypestr.startswith('class '): # handle new class type of python 2.2+ if ConfigVarTypeStrings.index('instance') in filter: continue valtype = valtypestr else: valtype = valtypestr[6:-1] - try: - if ConfigVarTypeStrings.index(valtype) in filter: - continue - except ValueError: - if valtype == "classobj": - if ConfigVarTypeStrings.index( - 'instance') in filter: + if valtype not in ConfigVarTypeStrings: + if valtype == "numpy.ndarray": + if ConfigVarTypeStrings.index('list') in filter: + continue + elif valtypename == "MultiValueDict": + if ConfigVarTypeStrings.index('dict') in filter: continue elif valtype == "sip.methoddescriptor": if ConfigVarTypeStrings.index( @@ -1687,22 +1690,51 @@ elif valtype == "sip.enumtype": if ConfigVarTypeStrings.index('class') in filter: continue - elif not valtype.startswith("PySide") and \ - ConfigVarTypeStrings.index('other') in filter: + elif ConfigVarTypeStrings.index('instance') in filter: continue + + if valtypename not in ["MultiValueDict"] and \ + not valtype.startswith("numpy"): + valtype = valtypestr + else: + try: + if ConfigVarTypeStrings.index(valtype) in filter: + continue + except ValueError: + if valtype == "classobj": + if ConfigVarTypeStrings.index( + 'instance') in filter: + continue + elif valtype == "sip.methoddescriptor": + if ConfigVarTypeStrings.index( + 'method') in filter: + continue + elif valtype == "sip.enumtype": + if ConfigVarTypeStrings.index('class') in \ + filter: + continue + elif not valtype.startswith("PySide") and \ + ConfigVarTypeStrings.index('other') in \ + filter: + continue try: - if valtype not in ['list', 'tuple', 'dict', 'set', - 'frozenset']: + if valtype in ['list', 'tuple', 'dict', 'set', + 'frozenset']: + if valtype == 'dict': + rvalue = "%d" % len(value.keys()) + else: + rvalue = "%d" % len(value) + elif valtype == "numpy.ndarray": + rvalue = "%d" % value.size + elif valtypename == "MultiValueDict": + rvalue = "%d" % len(value.keys()) + valtype = "django.MultiValueDict" # shortened type + else: rvalue = repr(value) if valtype.startswith('class') and \ rvalue[0] in ['{', '(', '[']: rvalue = "" - else: - if valtype == 'dict': - rvalue = "%d" % len(value.keys()) - else: - rvalue = "%d" % len(value) except Exception: rvalue = ''