[pypy-commit] pypy cpyext-gc-support: Test and fix

arigo noreply at buildbot.pypy.org
Tue Oct 20 06:00:51 EDT 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: cpyext-gc-support
Changeset: r80350:c6004c0c00ee
Date: 2015-10-20 12:00 +0200
http://bitbucket.org/pypy/pypy/changeset/c6004c0c00ee/

Log:	Test and fix

diff --git a/rpython/rlib/rawrefcount.py b/rpython/rlib/rawrefcount.py
--- a/rpython/rlib/rawrefcount.py
+++ b/rpython/rlib/rawrefcount.py
@@ -126,7 +126,7 @@
     _p_list = new_p_list
     for ob, wr in wr_p_list:
         p = attach(ob, wr, _p_list)
-        if p:
+        if p is not None:
             _pypy2ob[p] = ob
     _o_list = []
     for ob, wr in wr_o_list:
diff --git a/rpython/rlib/test/test_rawrefcount.py b/rpython/rlib/test/test_rawrefcount.py
--- a/rpython/rlib/test/test_rawrefcount.py
+++ b/rpython/rlib/test/test_rawrefcount.py
@@ -10,6 +10,8 @@
 class W_Root(object):
     def __init__(self, intval=0):
         self.intval = intval
+    def __nonzero__(self):
+        raise Exception("you cannot do that, you must use space.is_true()")
 
 PyObjectS = lltype.Struct('PyObjectS',
                           ('c_ob_refcnt', lltype.Signed),


More information about the pypy-commit mailing list