eric6/Debugger/VariablesViewer.py

changeset 7332
49076c600903
parent 7251
bc5b1b00560a
child 7360
9190402e4505
--- a/eric6/Debugger/VariablesViewer.py	Wed Nov 06 18:35:11 2019 +0100
+++ b/eric6/Debugger/VariablesViewer.py	Wed Nov 06 22:30:54 2019 +0100
@@ -44,6 +44,7 @@
     rx_nonprintable = QRegExp(r"""(\\x\d\d)+""")
     
     noOfItemsStr = QCoreApplication.translate("VariablesViewer", "{0} items")
+    unsized = QCoreApplication.translate("VariablesViewer", "unsized")
     
     arrayTypes = {
         'list', 'tuple', 'dict', 'set', 'frozenset', 'numpy.ndarray',
@@ -178,8 +179,11 @@
             self.indicator = VariableItem.Type2Indicators.get(dtype, '')
         
         if dtype == 'numpy.ndarray':
-            self.childCount = int(dvalue.split('x')[0])
-            dvalue = VariableItem.noOfItemsStr.format(dvalue)
+            if dvalue:
+                self.childCount = int(dvalue.split('x')[0])
+                dvalue = VariableItem.noOfItemsStr.format(dvalue)
+            else:
+                dvalue = VariableItem.unsized
             self.hasChildren = True
         elif dtype in VariableItem.arrayTypes:
             self.childCount = int(dvalue)

eric ide

mercurial