mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
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).
This commit is contained in:
parent
3caca2326e
commit
2556f2e1e2
1 changed files with 1 additions and 1 deletions
|
@ -3554,7 +3554,7 @@ build_class(PyObject *methods, PyObject *bases, PyObject *name)
|
||||||
if (PyDict_Check(methods))
|
if (PyDict_Check(methods))
|
||||||
metaclass = PyDict_GetItemString(methods, "__metaclass__");
|
metaclass = PyDict_GetItemString(methods, "__metaclass__");
|
||||||
if (metaclass != NULL)
|
if (metaclass != NULL)
|
||||||
Py_INCREF(methods);
|
Py_INCREF(metaclass);
|
||||||
else if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
|
else if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
|
||||||
base = PyTuple_GET_ITEM(bases, 0);
|
base = PyTuple_GET_ITEM(bases, 0);
|
||||||
metaclass = PyObject_GetAttrString(base, "__class__");
|
metaclass = PyObject_GetAttrString(base, "__class__");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue