fix slicing for 1d
authorAlexander Marchuk <Alexander.Marchuk@jetbrains.com>
Thu, 6 Nov 2014 16:03:37 +0000 (19:03 +0300)
committerAlexander Marchuk <Alexander.Marchuk@jetbrains.com>
Thu, 6 Nov 2014 16:03:37 +0000 (19:03 +0300)
python/helpers/pydev/pydevd_vars.py

index d9e1d28c37c53be602fbc56423a0759da98fbdbd..db297f9919281f74d1e59041964102d52740f6cc 100644 (file)
@@ -399,16 +399,17 @@ def array_to_xml(array, roffset, coffset, rows, cols, format):
         cols = 1
     elif rows == 1 or cols == 1:
         is_row = True if (rows == 1) else False
-        pure_1d = False if (len(array) == 1) else True
+        if is_row:
+            array = array[roffset:]
+        else:
+            array = array[coffset:]
 
-        if not pure_1d:
+        if len(array) == 1:
             array = array[0]
 
         if is_row:
-            array = array[coffset:]
             cols = min(cols, len(array))
         else:
-            array = array[roffset:]
             rows = min(rows, len(array))
     else:
         array = array[roffset:, coffset:]