eric6/DebugClients/Python/DebugVariables.py

changeset 7332
49076c600903
parent 7250
d8bdc55aee1a
child 7360
9190402e4505
diff -r 1fb70d1f8a39 -r 49076c600903 eric6/DebugClients/Python/DebugVariables.py
--- a/eric6/DebugClients/Python/DebugVariables.py	Wed Nov 06 18:35:11 2019 +0100
+++ b/eric6/DebugClients/Python/DebugVariables.py	Wed Nov 06 22:30:54 2019 +0100
@@ -414,7 +414,11 @@
         """
         d = {}
         start = count = 0
-        allItems = var.tolist()
+        try:
+            len(var)  # Check if it's an unsized object, e.g. np.ndarray(())
+            allItems = var.tolist()
+        except TypeError:  # TypeError: len() of unsized object
+            allItems = []
         
         for idx, value in enumerate(allItems):
             d[str(idx)] = value

eric ide

mercurial