don't leak if the __class__ closure is set

This commit is contained in:
Benjamin Peterson 2012-06-01 23:57:36 -07:00
parent ae1b94b6e4
commit 8e8fbeae27
1 changed files with 2 additions and 4 deletions

View File

@ -158,10 +158,8 @@ builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds)
cls = PyEval_CallObjectWithKeywords(meta, margs, mkw);
Py_DECREF(margs);
}
if (cls != NULL && PyCell_Check(cell)) {
Py_INCREF(cls);
PyCell_SET(cell, cls);
}
if (cls != NULL && PyCell_Check(cell))
PyCell_Set(cell, cls);
Py_DECREF(cell);
}
Py_DECREF(ns);