diff -r 718f80d8bcde -r 77845f40ebfe eric7/DebugClients/Python/DebugVariables.py --- a/eric7/DebugClients/Python/DebugVariables.py Fri Sep 03 19:14:36 2021 +0200 +++ b/eric7/DebugClients/Python/DebugVariables.py Fri Sep 03 19:56:21 2021 +0200 @@ -269,7 +269,7 @@ containing the variable attributes @ytype tuple of (int, list) """ - return super().getVariableList(list(var)) + yield from super().getVariableList(list(var)) ############################################################ @@ -430,12 +430,18 @@ d = super().getVariableList(var) if var.size > 1024 * 1024: - d.append(('min', - 'ndarray too big, calculating min would slow down debugging')) - d.append(('max', - 'ndarray too big, calculating max would slow down debugging')) - d.append(('mean', - 'ndarray too big, calculating mean would slow down debugging')) + d.append( + ('min', + 'ndarray too big, calculating min would slow down debugging') + ) + d.append( + ('max', + 'ndarray too big, calculating max would slow down debugging') + ) + d.append( + ('mean', + 'ndarray too big, calculating mean would slow down debugging') + ) elif self.__isNumeric(var): if var.size == 0: d.append(('min', 'empty array')) @@ -650,7 +656,7 @@ attributes = () # Gently handle exception which could occure as special # cases, e.g. already deleted C++ objects, str conversion.. - try: + with contextlib.suppress(Exception): qttype = type(var).__name__ if qttype in ('QLabel', 'QPushButton'): @@ -658,10 +664,14 @@ elif qttype == 'QByteArray': d.append(('bytes', bytes(var))) d.append(('hex', "QByteArray", "{0}".format(var.toHex()))) - d.append(('base64', "QByteArray", - "{0}".format(var.toBase64()))) - d.append(('percent encoding', "QByteArray", - "{0}".format(var.toPercentEncoding()))) + d.append( + ('base64', "QByteArray", + "{0}".format(var.toBase64())) + ) + d.append( + ('percent encoding', "QByteArray", + "{0}".format(var.toPercentEncoding())) + ) elif qttype in ('QPoint', 'QPointF'): attributes = ('x', 'y') elif qttype in ('QRect', 'QRectF'): @@ -681,7 +691,7 @@ c, m, y, k, a = var.getCmyk() d.append( ('cmyka', - "{0:d}, {1:d}, {2:d}, {3:d}, {4:d}".format(c, m, y, k, a)) + "{0:d}, {1:d}, {2:d}, {3:d}, {4:d}".format(c, m, y, k, a)) ) elif qttype in ('QDate', 'QTime', 'QDateTime'): d.append((qttype[1:].lower(), var.toString())) @@ -733,8 +743,6 @@ elif qttype == 'EnumType': # Not in PyQt possible for key, value in var.values.items(): d.append((key, int(value))) - except Exception: - pass for attribute in attributes: d.append((attribute, getattr(var, attribute)()))