From 4be98911eda8a3b09b36e92b653bdfabe9108a30 Mon Sep 17 00:00:00 2001 From: Elizaveta Shashkova Date: Wed, 31 Jul 2019 16:50:55 +0300 Subject: [PATCH] IDEA-CR-50936: PY-37063 Check shape attribute GitOrigin-RevId: 042b70061f8f3b9a063c7c177dea8e43923a016f --- python/helpers/pydev/_pydevd_bundle/pydevd_xml.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/helpers/pydev/_pydevd_bundle/pydevd_xml.py b/python/helpers/pydev/_pydevd_bundle/pydevd_xml.py index 69b604a108a1..ad203178471e 100644 --- a/python/helpers/pydev/_pydevd_bundle/pydevd_xml.py +++ b/python/helpers/pydev/_pydevd_bundle/pydevd_xml.py @@ -244,8 +244,8 @@ def is_numpy(x): or 'float' in type_name or 'complex' in type_name -def is_numeric_container(var_type): - return var_type in ("ndarray", "DataFrame", "Series") +def is_numeric_container(var_type, var): + return var_type in ("ndarray", "DataFrame", "Series") and hasattr(var, "shape") def should_evaluate_full_value(val): @@ -380,7 +380,7 @@ def var_to_xml(val, name, doTrim=True, additional_in_xml='', evaluate_full_value else: xml_value = '' - if is_numeric_container(typeName): + if is_numeric_container(typeName, v): xml_shape = ' shape="%s"' % make_valid_xml_value(str(v.shape)) else: xml_shape = ''