Skip to content

Commit

Permalink
Merge pull request #21447 from charris/backport-21321
Browse files Browse the repository at this point in the history
BUG: Stop using PyBytesObject.ob_shash deprecated in Python 3.11.
  • Loading branch information
charris committed May 5, 2022
2 parents fdb5393 + 710fbbd commit 070be22
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 070be22

Please sign in to comment.