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

Skip to content

Commit 0a9e86a

Browse files
committed
Merge branch 'iterable' of git://github.com/mdboom/matplotlib
2 parents 79984f7 + 2a0c65e commit 0a9e86a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/matplotlib/cbook.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,10 @@ def unique(x):
374374

375375
def iterable(obj):
376376
'return true if *obj* is iterable'
377-
try: len(obj)
378-
except: return False
377+
try:
378+
iter(obj)
379+
except TypeError:
380+
return False
379381
return True
380382

381383

0 commit comments

Comments
 (0)