mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
bpo-42423: Accept single base class in PyType_FromModuleAndSpec() (GH-23441)
This commit is contained in:
parent
c4d45ee670
commit
686c203cd4
7 changed files with 17 additions and 28 deletions
|
@ -2993,8 +2993,9 @@ PyType_FromModuleAndSpec(PyObject *module, PyType_Spec *spec, PyObject *bases)
|
|||
}
|
||||
}
|
||||
else if (!PyTuple_Check(bases)) {
|
||||
PyErr_SetString(PyExc_SystemError, "bases is not a tuple");
|
||||
goto fail;
|
||||
bases = PyTuple_Pack(1, bases);
|
||||
if (!bases)
|
||||
goto fail;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(bases);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue