src/eric7/DebugClients/Python/DebugVariables.py

branch
eric7
changeset 10332
7308cfc6e558
parent 10180
3a595df36c9a
child 10373
093dcebe5ecb
--- a/src/eric7/DebugClients/Python/DebugVariables.py	Wed Nov 22 17:19:10 2023 +0100
+++ b/src/eric7/DebugClients/Python/DebugVariables.py	Wed Nov 22 19:42:16 2023 +0100
@@ -12,7 +12,12 @@
 
 from collections.abc import ItemsView, KeysView, ValuesView
 
-from DebugConfig import BatchSize, ConfigKnownQtTypes, ConfigQtNames
+from DebugConfig import (
+    BatchSize,
+    ConfigKnownQtTypes,
+    ConfigQtNames,
+    UnknownAttributeValueMarker,
+)
 
 #
 # This code was inspired by pydevd.
@@ -52,9 +57,15 @@
         """
         d = []
         for name in dir(var):
-            with contextlib.suppress(AttributeError):
+            try:
                 attribute = getattr(var, name)
                 d.append((name, attribute))
+            except AttributeError:
+                # ignore non-existent attributes
+                pass
+            except Exception as exc:
+                # The attribute value cannot be determined/is not available yet.
+                d.append((name, "{0}{1}".format(UnknownAttributeValueMarker, str(exc))))
 
         return d
 
@@ -79,11 +90,7 @@
             containing the variable attributes
         @ytype tuple of (int, list)
         """
-        d = []
-        for name in dir(var):
-            with contextlib.suppress(AttributeError):
-                attribute = getattr(var, name)
-                d.append((name, attribute))
+        d = super().getVariableList(var)
 
         yield -1, d
         while True:

eric ide

mercurial