[Python-checkins] cpython (3.2): don't leak if the __class__ closure is set

benjamin.peterson python-checkins at python.org
Sat Jun 2 08:58:08 CEST 2012


http://hg.python.org/cpython/rev/ba01cf9a8578
changeset: 77293:ba01cf9a8578
branch: 3.2
parent: 77288:24572015e24f
user: Benjamin Peterson <benjamin at python.org>
date: Fri Jun 01 23:57:36 2012 -0700
summary:
 don't leak if the __class__ closure is set
files:
 Python/bltinmodule.c | 6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
--- 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);
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /