[Python-checkins] cpython: Issue #18408: Fix Py_ReprEnter(), handle PyList_Append() failure

victor.stinner python-checkins at python.org
Wed Jul 17 22:11:57 CEST 2013


http://hg.python.org/cpython/rev/2f5f1db8eb88
changeset:   84696:2f5f1db8eb88
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Wed Jul 17 21:58:41 2013 +0200
summary:
  Issue #18408: Fix Py_ReprEnter(), handle PyList_Append() failure

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


diff --git a/Objects/object.c b/Objects/object.c
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1910,7 +1910,8 @@
         if (PyList_GET_ITEM(list, i) == obj)
             return 1;
     }
-    PyList_Append(list, obj);
+    if (PyList_Append(list, obj) < 0)
+        return -1;
     return 0;
 }
 

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


More information about the Python-checkins mailing list