summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-01-30 01:17:07 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-01-30 01:17:07 (GMT)
commit2372bb07221a44df0bed6a237e243ea36d92906e (patch)
treef6677325e9e0b0b867d44ebb2696f5421f6f56f5
parent2d6251c7f7cf059eb80d5e853399732b9f74509c (diff)
parent2652d2570ea2d34fc790ef99ebd0c3c321fb86cb (diff)
downloadcpython-2372bb07221a44df0bed6a237e243ea36d92906e.zip
cpython-2372bb07221a44df0bed6a237e243ea36d92906e.tar.gz
cpython-2372bb07221a44df0bed6a237e243ea36d92906e.tar.bz2
merge 3.2 (closes #13908)
-rw-r--r--Misc/NEWS2
-rw-r--r--Objects/typeobject.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 6611537..2607618 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,8 @@ What's New in Python 3.3 Alpha 1?
Core and Builtins
-----------------
+- Issue #13908: Ready types returned from PyType_FromSpec.
+
- Issue #11235: Fix OverflowError when trying to import a source file whose
modification time doesn't fit in a 32-bit timestamp.
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 2c6ac42..495cc6d 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2394,7 +2394,8 @@ static short slotoffsets[] = {
#include "typeslots.inc"
};
-PyObject* PyType_FromSpec(PyType_Spec *spec)
+PyObject *
+PyType_FromSpec(PyType_Spec *spec)
{
PyHeapTypeObject *res = (PyHeapTypeObject*)PyType_GenericAlloc(&PyType_Type, 0);
char *res_start = (char*)res;
@@ -2434,6 +2435,9 @@ PyObject* PyType_FromSpec(PyType_Spec *spec)
}
}
+ if (PyType_Ready(&res->ht_type) < 0)
+ goto fail;
+
return (PyObject*)res;
fail: