Commit 8e8fbeae authored by Benjamin Peterson's avatar Benjamin Peterson

don't leak if the __class__ closure is set

parent ae1b94b6
...@@ -158,10 +158,8 @@ builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds) ...@@ -158,10 +158,8 @@ builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds)
cls = PyEval_CallObjectWithKeywords(meta, margs, mkw); cls = PyEval_CallObjectWithKeywords(meta, margs, mkw);
Py_DECREF(margs); Py_DECREF(margs);
} }
if (cls != NULL && PyCell_Check(cell)) { if (cls != NULL && PyCell_Check(cell))
Py_INCREF(cls); PyCell_Set(cell, cls);
PyCell_SET(cell, cls);
}
Py_DECREF(cell); Py_DECREF(cell);
} }
Py_DECREF(ns); Py_DECREF(ns);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment