diff options
| author | Benjamin Peterson <benjamin@python.org> | 2012-06-01 23:57:36 -0700 |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2012-06-01 23:57:36 -0700 |
| commit | f537e1076cff1a46a732a094052dc0060b0414a6 (patch) | |
| tree | b849689cb5e5b84d7190cf194943d51618ac6cb2 /Python/bltinmodule.c | |
| parent | ce2fa3b93139579f1488ec819f7ae736b3847653 (diff) | |
| download | cpython-f537e1076cff1a46a732a094052dc0060b0414a6.tar.gz | |
don't leak if the __class__ closure is set
Diffstat (limited to 'Python/bltinmodule.c')
| -rw-r--r-- | Python/bltinmodule.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index e2ff0ba1c5..232e3dc497 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -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); |
