]> granicus.if.org Git - python/commitdiff
merge 3.2
authorBenjamin Peterson <benjamin@python.org>
Wed, 17 Aug 2011 03:27:42 +0000 (22:27 -0500)
committerBenjamin Peterson <benjamin@python.org>
Wed, 17 Aug 2011 03:27:42 +0000 (22:27 -0500)
1  2 
Objects/typeobject.c

index 3c1d3a1681f4cdb5329fccfaa0f68a63688c63ec,856a4a5f386dd2368a2f78bc347fa8ba041b10b3..3971062eadfa232160701e9baba1512df514a94a
@@@ -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);