summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-10-07 02:42:46 (GMT)
committerBenjamin Peterson <benjamin@python.org>2015-10-07 02:42:46 (GMT)
commitcdae2cb88abdc6e92ef0364cf3cc6d85bff8f72c (patch)
treedcd65f45534243495f0961a8ac3694b19e00f076 /Objects
parent4d17a6aceed79577bc4d35c733fc0ce3181bbd03 (diff)
parent59dc696821da8888b5ac1b86c6c0fd4202f92b39 (diff)
downloadcpython-cdae2cb88abdc6e92ef0364cf3cc6d85bff8f72c.zip
cpython-cdae2cb88abdc6e92ef0364cf3cc6d85bff8f72c.tar.gz
cpython-cdae2cb88abdc6e92ef0364cf3cc6d85bff8f72c.tar.bz2
merge 3.5 (closes #24806)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index a311e99..72fa3d3 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -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)