mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-39943: Add the const qualifier to pointers on non-mutable PyUnicode data. (GH-19345)
This commit is contained in:
parent
7ec43a7309
commit
cd8295ff75
27 changed files with 250 additions and 221 deletions
|
@ -3208,7 +3208,7 @@ is_dunder_name(PyObject *name)
|
|||
int kind = PyUnicode_KIND(name);
|
||||
/* Special names contain at least "__x__" and are always ASCII. */
|
||||
if (length > 4 && kind == PyUnicode_1BYTE_KIND) {
|
||||
Py_UCS1 *characters = PyUnicode_1BYTE_DATA(name);
|
||||
const Py_UCS1 *characters = PyUnicode_1BYTE_DATA(name);
|
||||
return (
|
||||
((characters[length-2] == '_') && (characters[length-1] == '_')) &&
|
||||
((characters[0] == '_') && (characters[1] == '_'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue