Skip to content

Commit

Permalink
BUG: Stop using PyBytesObject.ob_shash deprecated in Python 3.11, fixes
Browse files Browse the repository at this point in the history
#21317.

PyBytesObject.ob_shash was deprecated in Python 3.11.
  • Loading branch information
felixxm authored and charris committed May 5, 2022
1 parent 65bbf0c commit 710fbbd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion numpy/core/src/multiarray/scalarapi.c
Expand Up @@ -773,7 +773,9 @@ PyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base)
if (PyTypeNum_ISFLEXIBLE(type_num)) {
if (type_num == NPY_STRING) {
destptr = PyBytes_AS_STRING(obj);
((PyBytesObject *)obj)->ob_shash = -1;
#if PY_VERSION_HEX < 0x030b00b0
((PyBytesObject *)obj)->ob_shash = -1;
#endif
memcpy(destptr, data, itemsize);
return obj;
}
Expand Down

0 comments on commit 710fbbd

Please sign in to comment.