mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Fixes for issue 1752184, ensuring type objects are always created
with a PyUnicode name.
This commit is contained in:
parent
15c974651f
commit
e845c0f922
4 changed files with 15 additions and 6 deletions
|
@ -410,7 +410,7 @@ static PyTypeObject* make_type(char *type, PyTypeObject* base, char**fields, int
|
|||
}
|
||||
PyTuple_SET_ITEM(fnames, i, field);
|
||||
}
|
||||
result = PyObject_CallFunction((PyObject*)&PyType_Type, "s(O){sOss}",
|
||||
result = PyObject_CallFunction((PyObject*)&PyType_Type, "U(O){sOss}",
|
||||
type, base, "_fields", fnames, "__module__", "_ast");
|
||||
Py_DECREF(fnames);
|
||||
return (PyTypeObject*)result;
|
||||
|
|
|
@ -608,7 +608,7 @@ PyErr_NewException(const char *name, PyObject *base, PyObject *dict)
|
|||
goto failure;
|
||||
}
|
||||
/* Create a real new-style class. */
|
||||
result = PyObject_CallFunction((PyObject *)&PyType_Type, "sOO",
|
||||
result = PyObject_CallFunction((PyObject *)&PyType_Type, "UOO",
|
||||
dot+1, bases, dict);
|
||||
failure:
|
||||
Py_XDECREF(bases);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue