[pypy-commit] pypy refactor-wrapped-del: Fix on top of CPython 2.6 (it worked on top of CPython 2.5)

arigo noreply at buildbot.pypy.org
Wed Jul 13 14:16:55 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: refactor-wrapped-del
Changeset: r45541:69a6931f84e2
Date: 2011-07-12 18:11 +0200
http://bitbucket.org/pypy/pypy/changeset/69a6931f84e2/

Log:	Fix on top of CPython 2.6 (it worked on top of CPython 2.5)

diff --git a/pypy/interpreter/test/test_typedef.py b/pypy/interpreter/test/test_typedef.py
--- a/pypy/interpreter/test/test_typedef.py
+++ b/pypy/interpreter/test/test_typedef.py
@@ -184,9 +184,13 @@
     def test_destructor(self):
         space = self.space
         class W_Level1(Wrappable):
+            def __init__(self, space1):
+                assert space1 is space
             def __del__(self):
                 space.call_method(w_seen, 'append', space.wrap(1))
         class W_Level2(Wrappable):
+            def __init__(self, space1):
+                assert space1 is space
             def __del__(self):
                 self.enqueue_for_destruction(space, W_Level2.destructormeth,
                                              'FOO ')
@@ -200,12 +204,12 @@
             __new__ = typedef.generic_new_descr(W_Level2))
         #
         w_seen = space.newlist([])
-        W_Level1()
+        W_Level1(space)
         gc.collect(); gc.collect()
         assert space.unwrap(w_seen) == [1]
         #
         w_seen = space.newlist([])
-        W_Level2()
+        W_Level2(space)
         gc.collect(); gc.collect()
         assert space.str_w(space.repr(w_seen)) == "[]"  # not called yet
         ec = space.getexecutioncontext()


More information about the pypy-commit mailing list