From 0375a3243242ffb44f5debe0a08af2b0d4c948b9 Mon Sep 17 00:00:00 2001 From: Guillaume Viejo Date: Thu, 9 May 2024 15:36:48 -0400 Subject: [PATCH 1/2] fixing is_array_like --- pynapple/core/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pynapple/core/utils.py b/pynapple/core/utils.py index b6ea1e24..55e2f685 100644 --- a/pynapple/core/utils.py +++ b/pynapple/core/utils.py @@ -125,7 +125,7 @@ def is_array_like(obj): try: obj[0] is_indexable = True - except (TypeError, IndexError): + except Exception: is_indexable = False # Check for iterable property From 28e6e20c64851d317942e3e5d9c88885b58afe73 Mon Sep 17 00:00:00 2001 From: Guillaume Viejo Date: Thu, 9 May 2024 15:38:03 -0400 Subject: [PATCH 2/2] adding exception --- pynapple/core/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pynapple/core/utils.py b/pynapple/core/utils.py index 55e2f685..17d90546 100644 --- a/pynapple/core/utils.py +++ b/pynapple/core/utils.py @@ -132,7 +132,7 @@ def is_array_like(obj): try: iter(obj) is_iterable = True - except TypeError: + except Exception: is_iterable = False # not_tsd_type = not isinstance(obj, _AbstractTsd)