Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fffd947

Browse files
committed
Fix a buglet affecting getp: if a numpy object has shape==(),
you cannot take its length. svn path=/trunk/matplotlib/; revision=3731
1 parent 520e471 commit fffd947

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/matplotlib/artist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ def pprint_getters(self):
588588
if self.is_alias(func): continue
589589
try: val = func()
590590
except: continue
591-
if hasattr(val, 'shape') and len(val)>6:
591+
if getattr(val, 'shape', ()) != () and len(val)>6:
592592
s = str(val[:6]) + '...'
593593
else:
594594
s = str(val)

0 commit comments

Comments
 (0)