[Python-checkins] cpython (merge 3.2 -> default): Partly revert ad3824a90261 and add comment about reference ownership

christian.heimes python-checkins at python.org
Wed Sep 12 17:54:08 CEST 2012


http://hg.python.org/cpython/rev/c1b950541e46
changeset:   79007:c1b950541e46
parent:      79005:2fa7c104f909
parent:      79006:2888356cdd4e
user:        Christian Heimes <christian at cheimes.de>
date:        Wed Sep 12 17:53:15 2012 +0200
summary:
  Partly revert ad3824a90261 and add comment about reference ownership

files:
  Python/symtable.c |  3 +--
  1 files changed, 1 insertions(+), 2 deletions(-)


diff --git a/Python/symtable.c b/Python/symtable.c
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -33,7 +33,7 @@
     if (ste == NULL)
         goto fail;
     ste->ste_table = st;
-    ste->ste_id = k;
+    ste->ste_id = k; /* ste owns reference to k */
 
     ste->ste_name = name;
     Py_INCREF(name);
@@ -79,7 +79,6 @@
 
     return ste;
  fail:
-    Py_XDECREF(k);
     Py_XDECREF(ste);
     return NULL;
 }

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


More information about the Python-checkins mailing list