[pypy-commit] pypy default: check tuple, not contents

mattip pypy.commits at gmail.com
Mon May 29 18:49:39 EDT 2017


Author: Matti Picus <matti.picus at gmail.com>
Branch: 
Changeset: r91438:1049e523ffdb
Date: 2017-05-30 01:48 +0300
http://bitbucket.org/pypy/pypy/changeset/1049e523ffdb/

Log:	check tuple, not contents

diff --git a/pypy/module/cpyext/tupleobject.py b/pypy/module/cpyext/tupleobject.py
--- a/pypy/module/cpyext/tupleobject.py
+++ b/pypy/module/cpyext/tupleobject.py
@@ -141,7 +141,7 @@
         decref(space, py_obj)
         raise oefmt(space.w_IndexError, "tuple assignment index out of range")
     old_ref = ref.c_ob_item[index]
-    if old_ref and pyobj_has_w_obj(old_ref):
+    if pyobj_has_w_obj(ref):
         # similar but not quite equal to ref.c_ob_refcnt != 1 on CPython
         raise oefmt(space.w_SystemError, "PyTuple_SetItem called on tuple after"
                                         " use of tuple")


More information about the pypy-commit mailing list