Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2556f2e

Browse files
committed
Fix a typo (probably caused by autocompletion <blush>) that caused a
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).
1 parent 3caca23 commit 2556f2e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Python/ceval.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3554,7 +3554,7 @@ build_class(PyObject *methods, PyObject *bases, PyObject *name)
35543554
if (PyDict_Check(methods))
35553555
metaclass = PyDict_GetItemString(methods, "__metaclass__");
35563556
if (metaclass != NULL)
3557-
Py_INCREF(methods);
3557+
Py_INCREF(metaclass);
35583558
else if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
35593559
base = PyTuple_GET_ITEM(bases, 0);
35603560
metaclass = PyObject_GetAttrString(base, "__class__");

0 commit comments

Comments
 (0)