Mercurial > cpython-lru_cache-weakref
diff Python/bltinmodule.c @ 77293:ba01cf9a8578 3.2
don't leak if the __class__ closure is set
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Fri, 01 Jun 2012 23:57:36 -0700 |
| parents | 068e5c4d4bae |
| children | 56dc7b09f390 56650edb95a2 |
line wrap: on
line diff
--- a/Python/bltinmodule.c Fri Jun 01 16:19:36 2012 -0400 +++ b/Python/bltinmodule.c Fri Jun 01 23:57:36 2012 -0700 @@ -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);
