Skip to content

Commit

Permalink
Fixed on PyPy
Browse files Browse the repository at this point in the history
  • Loading branch information
YannickJadoul committed Jan 17, 2021
1 parent 2231d9c commit 2eb35ac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/pybind11/cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -1046,10 +1046,11 @@ struct type_caster<T, enable_if_t<std::is_arithmetic<T>::value && !is_std_char_t
handle obj = src;
#if PY_VERSION_HEX < 0x03080000
bool do_decref = false;
if (PyIndex_Check(src.ptr())) {
if (index_check(src.ptr())) {
PyObject *tmp = PyNumber_Index(src.ptr());
if (!tmp) {
py_value = (py_type) -1;
PyErr_Clear();
return false;
}
do_decref = true;
obj = tmp;
Expand Down

0 comments on commit 2eb35ac

Please sign in to comment.