mirror of
https://github.com/python/cpython.git
synced 2025-07-19 09:15:34 +00:00
merge 3.5 (closes #24806)
This commit is contained in:
commit
cdae2cb88a
3 changed files with 40 additions and 6 deletions
|
@ -1973,6 +1973,12 @@ best_base(PyObject *bases)
|
|||
if (PyType_Ready(base_i) < 0)
|
||||
return NULL;
|
||||
}
|
||||
if (!PyType_HasFeature(base_i, Py_TPFLAGS_BASETYPE)) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"type '%.100s' is not an acceptable base type",
|
||||
base_i->tp_name);
|
||||
return NULL;
|
||||
}
|
||||
candidate = solid_base(base_i);
|
||||
if (winner == NULL) {
|
||||
winner = candidate;
|
||||
|
@ -2353,12 +2359,6 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
|
|||
if (base == NULL) {
|
||||
goto error;
|
||||
}
|
||||
if (!PyType_HasFeature(base, Py_TPFLAGS_BASETYPE)) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"type '%.100s' is not an acceptable base type",
|
||||
base->tp_name);
|
||||
goto error;
|
||||
}
|
||||
|
||||
dict = PyDict_Copy(orig_dict);
|
||||
if (dict == NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue