commit | 8e8fbeae27e3fbfa80ad59fd2aeb563116e6a4c4 | [log] [tgz] |
---|---|---|
author | Benjamin Peterson <benjamin@python.org> | Fri Jun 01 23:57:36 2012 -0700 |
committer | Benjamin Peterson <benjamin@python.org> | Fri Jun 01 23:57:36 2012 -0700 |
tree | b09f29ebfc88d2870efaa2339732561930956d4d | |
parent | ae1b94b6e4091f9b8c9249ad535a2f121030dd2e [diff] |
don't leak if the __class__ closure is set
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index e2ff0ba..232e3dc 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c
@@ -158,10 +158,8 @@ 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);