mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-39943: Add the const qualifier to pointers on non-mutable PyBytes data. (GH-19472)
This commit is contained in:
parent
3e0dd3730b
commit
8f87eefe7f
20 changed files with 38 additions and 37 deletions
|
@ -1785,7 +1785,7 @@ s_pack_internal(PyStructObject *soself, PyObject *const *args, int offset, char*
|
|||
if (e->format == 's') {
|
||||
Py_ssize_t n;
|
||||
int isstring;
|
||||
void *p;
|
||||
const void *p;
|
||||
isstring = PyBytes_Check(v);
|
||||
if (!isstring && !PyByteArray_Check(v)) {
|
||||
PyErr_SetString(_structmodulestate_global->StructError,
|
||||
|
@ -1807,7 +1807,7 @@ s_pack_internal(PyStructObject *soself, PyObject *const *args, int offset, char*
|
|||
} else if (e->format == 'p') {
|
||||
Py_ssize_t n;
|
||||
int isstring;
|
||||
void *p;
|
||||
const void *p;
|
||||
isstring = PyBytes_Check(v);
|
||||
if (!isstring && !PyByteArray_Check(v)) {
|
||||
PyErr_SetString(_structmodulestate_global->StructError,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue