Skip to content

Commit 95587a9

Browse files
committed
Merge branch 'master' of github.com:InvestmentSystems/arraykit
2 parents 6d4eaa1 + ab9c64f commit 95587a9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/_arraykit.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3771,10 +3771,14 @@ isna_element(PyObject *m, PyObject *args, PyObject *kwargs)
37713771
// Try to identify Pandas Timestamp NATs
37723772
if (PyObject_HasAttrString(element, "to_numpy")) {
37733773
PyObject *to_numpy = PyObject_GetAttrString(element, "to_numpy");
3774+
if (to_numpy == NULL) {
3775+
return NULL;
3776+
}
37743777
if (!PyCallable_Check(to_numpy)) {
37753778
Py_RETURN_FALSE;
37763779
}
37773780
PyObject* post = PyObject_CallFunction(to_numpy, NULL);
3781+
Py_DECREF(to_numpy);
37783782
if (post == NULL) return NULL;
37793783
return PyBool_FromLong(PyArrayScalar_VAL(post, Datetime) == NPY_DATETIME_NAT);
37803784
}

0 commit comments

Comments
 (0)