mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
gh-89653: Use int type for Unicode kind (#92704)
Use the same type that PyUnicode_FromKindAndData() kind parameter type (public C API): int.
This commit is contained in:
parent
22a1db378c
commit
f62ad4f2c4
13 changed files with 49 additions and 52 deletions
|
@ -1230,9 +1230,6 @@ attrgetter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
/* prepare attr while checking args */
|
||||
for (idx = 0; idx < nattrs; ++idx) {
|
||||
PyObject *item = PyTuple_GET_ITEM(args, idx);
|
||||
Py_ssize_t item_len;
|
||||
const void *data;
|
||||
unsigned int kind;
|
||||
int dot_count;
|
||||
|
||||
if (!PyUnicode_Check(item)) {
|
||||
|
@ -1245,9 +1242,9 @@ attrgetter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
Py_DECREF(attr);
|
||||
return NULL;
|
||||
}
|
||||
item_len = PyUnicode_GET_LENGTH(item);
|
||||
kind = PyUnicode_KIND(item);
|
||||
data = PyUnicode_DATA(item);
|
||||
Py_ssize_t item_len = PyUnicode_GET_LENGTH(item);
|
||||
int kind = PyUnicode_KIND(item);
|
||||
const void *data = PyUnicode_DATA(item);
|
||||
|
||||
/* check whether the string is dotted */
|
||||
dot_count = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue