]> granicus.if.org Git - python/commitdiff
Fix a typo (probably caused by autocompletion <blush>) that caused a
authorGuido van Rossum <guido@python.org>
Thu, 6 Dec 2001 14:09:56 +0000 (14:09 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 6 Dec 2001 14:09:56 +0000 (14:09 +0000)
leak when a class defined a __metaclass__.  This fixes the problem
reported on python-dev by Ping; I dunno if it's the same as SF bug
#489669 (since that mentions Unicode).

Python/ceval.c

index 76424e107c85a3e5719ab91159b76715b6267344..6def4229172c4da16a01d89a97e082eb278e73d1 100644 (file)
@@ -3554,7 +3554,7 @@ build_class(PyObject *methods, PyObject *bases, PyObject *name)
        if (PyDict_Check(methods))
                metaclass = PyDict_GetItemString(methods, "__metaclass__");
        if (metaclass != NULL)
-               Py_INCREF(methods);
+               Py_INCREF(metaclass);
        else if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
                base = PyTuple_GET_ITEM(bases, 0);
                metaclass = PyObject_GetAttrString(base, "__class__");