[Python-checkins] cpython (2.7): use Py_CLEAR

benjamin.peterson python-checkins at python.org
Sun Feb 19 07:14:41 CET 2012


http://hg.python.org/cpython/rev/520d2818ff38
changeset:   75031:520d2818ff38
branch:      2.7
parent:      75027:2909e60e7e13
user:        Benjamin Peterson <benjamin at python.org>
date:        Sun Feb 19 01:11:56 2012 -0500
summary:
  use Py_CLEAR

files:
  Objects/funcobject.c |  4 +---
  1 files changed, 1 insertions(+), 3 deletions(-)


diff --git a/Objects/funcobject.c b/Objects/funcobject.c
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -784,9 +784,7 @@
 static int
 sm_clear(staticmethod *sm)
 {
-    Py_XDECREF(sm->sm_callable);
-    sm->sm_callable = NULL;
-
+    Py_CLEAR(sm->sm_callable);
     return 0;
 }
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list