[pypy-commit] pypy cpyext-refactor-methodobject: merge the fix from cpyext-avoid-roundtrip

antocuni pypy.commits at gmail.com
Sat Oct 14 11:24:47 EDT 2017


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: cpyext-refactor-methodobject
Changeset: r92765:e627947095d3
Date: 2017-10-14 17:24 +0200
http://bitbucket.org/pypy/pypy/changeset/e627947095d3/

Log:	merge the fix from cpyext-avoid-roundtrip

diff --git a/pypy/module/cpyext/test/test_sequence.py b/pypy/module/cpyext/test/test_sequence.py
--- a/pypy/module/cpyext/test/test_sequence.py
+++ b/pypy/module/cpyext/test/test_sequence.py
@@ -6,7 +6,7 @@
     PySequence_Fast, PySequence_Contains, PySequence_Index,
     PySequence_GetItem, PySequence_SetItem, PySequence_DelItem)
 from pypy.module.cpyext.pyobject import get_w_obj_and_decref
-
+from pypy.module.cpyext.state import State
 import pytest
 
 class TestSequence(BaseApiTest):
@@ -108,6 +108,7 @@
             PySequence_Contains(space, space.w_None, space.wrap(2))
 
     def test_setitem(self, space, api):
+        state = space.fromcache(State)
         w_value = space.wrap(42)
 
         l = api.PyList_New(1)
@@ -117,7 +118,7 @@
         with raises_w(space, IndexError):
             PySequence_SetItem(space, l, 3, w_value)
 
-        t = api.PyTuple_New(1)
+        t = state.C.PyTuple_New(1)
         api.PyTuple_SetItem(t, 0, l)
         with raises_w(space, TypeError):
             PySequence_SetItem(space, t, 0, w_value)


More information about the pypy-commit mailing list