Skip to content

Commit da1f74a

Browse files
committed
BUG: Propagate Python exceptions from c_is_list_like (pandas-dev#33721)
1 parent cf61be6 commit da1f74a

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

doc/source/whatsnew/v1.1.0.rst

+2
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,8 @@ Other
659659
- Bug in :meth:`Series.map` not raising on invalid ``na_action`` (:issue:`32815`)
660660
- Bug in :meth:`DataFrame.__dir__` caused a segfault when using unicode surrogates in a column name (:issue:`25509`)
661661
- Bug in :meth:`DataFrame.plot.scatter` caused an error when plotting variable marker sizes (:issue:`32904`)
662+
- Propagate Python exceptions from :func:`_lib.c_is_list_like` (#33721)
663+
-
662664

663665
.. ---------------------------------------------------------------------------
664666

pandas/_libs/lib.pxd

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cdef bint c_is_list_like(object, bint)
1+
cdef bint c_is_list_like(object, bint) except -1

pandas/_libs/lib.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ def is_list_like(obj: object, allow_sets: bool = True) -> bool:
985985
return c_is_list_like(obj, allow_sets)
986986

987987

988-
cdef inline bint c_is_list_like(object obj, bint allow_sets):
988+
cdef inline bint c_is_list_like(object obj, bint allow_sets) except -1:
989989
return (
990990
isinstance(obj, abc.Iterable)
991991
# we do not count strings/unicode/bytes as list-like

0 commit comments

Comments
 (0)