From: Benjamin Peterson Date: Wed, 17 Aug 2011 03:27:42 +0000 (-0500) Subject: merge 3.2 X-Git-Tag: v3.3.0a1~1689 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3e6267e7046b8d1473b2fd1c66dad9c4b8a81ae3;p=thirdparty%2FPython%2Fcpython.git merge 3.2 --- 3e6267e7046b8d1473b2fd1c66dad9c4b8a81ae3 diff --cc Objects/typeobject.c index 3c1d3a1681f4,856a4a5f386d..3971062eadfa --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@@ -2091,15 -2093,11 +2091,17 @@@ type_new(PyTypeObject *metatype, PyObje PyUnicode_CompareWithASCIIString(tmp, "__weakref__") == 0)) continue; tmp =_Py_Mangle(name, tmp); - if (!tmp) + if (!tmp) { + Py_DECREF(newslots); goto bad_slots; + } PyList_SET_ITEM(newslots, j, tmp); + if (PyDict_GetItem(dict, tmp)) { + PyErr_Format(PyExc_ValueError, + "%R in __slots__ conflicts with class variable", + tmp); + goto bad_slots; + } j++; } assert(j == nslots - add_dict - add_weak);