Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't try to get shape and ndim for objects that are not ndarrays #3544

Merged
merged 1 commit into from
Oct 16, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions spyder/utils/ipython/spyder_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,20 @@ def _is_series(self, var):
def _get_array_shape(self, var):
"""Return array's shape"""
try:
return var.shape
if self._is_array(var):
return var.shape
else:
return None
except AttributeError:
return None

def _get_array_ndim(self, var):
"""Return array's ndim"""
try:
return var.ndim
if self._is_array(var):
return var.ndim
else:
return None
except AttributeError:
return None

Expand Down