mirror of
https://github.com/python/cpython.git
synced 2026-01-06 23:42:34 +00:00
type_new(): cast PyObject_MALLOC's result to char*, for clarity.
This commit is contained in:
parent
527e64fd68
commit
59f809d3bc
1 changed files with 1 additions and 1 deletions
|
|
@ -909,7 +909,7 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
|
|||
PyObject *doc = PyDict_GetItemString(dict, "__doc__");
|
||||
if (doc != NULL && PyString_Check(doc)) {
|
||||
const size_t n = (size_t)PyString_GET_SIZE(doc);
|
||||
type->tp_doc = PyObject_MALLOC(n+1);
|
||||
type->tp_doc = (char *)PyObject_MALLOC(n+1);
|
||||
if (type->tp_doc == NULL) {
|
||||
Py_DECREF(type);
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue