Skip to content

Commit 76299b5

Browse files
committed
CLN: clean up _is_sequence
1 parent 02cb4da commit 76299b5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pandas/core/common.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,10 +1612,9 @@ def is_list_like(arg):
16121612
def _is_sequence(x):
16131613
try:
16141614
iter(x)
1615-
len(x) # it has a length
1616-
return not isinstance(x, compat.string_types +
1617-
(compat.binary_type,)) and True
1618-
except Exception:
1615+
len(x) # it has a length
1616+
return not isinstance(x, compat.string_types + (compat.binary_type,))
1617+
except (TypeError, AttributeError):
16191618
return False
16201619

16211620
_ensure_float64 = algos.ensure_float64

0 commit comments

Comments
 (0)