Author: mattip <matti.pi...@gmail.com>
Branch: cpyext-ext
Changeset: r83752:54c98869472f
Date: 2016-04-18 22:14 +0300
http://bitbucket.org/pypy/pypy/changeset/54c98869472f/

Log:    fixes from merge

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
@@ -10,7 +10,7 @@
         assert api.PySequence_Check(space.newlist([]))
         assert not api.PySequence_Check(space.newdict())
 
-    def test_sequence(self, space, api):
+    def test_sequence_api(self, space, api):
         w_l = space.wrap([1, 2, 3, 4])
         assert api.PySequence_Fast(w_l, "message") is w_l
 
diff --git a/pypy/objspace/fake/objspace.py b/pypy/objspace/fake/objspace.py
--- a/pypy/objspace/fake/objspace.py
+++ b/pypy/objspace/fake/objspace.py
@@ -64,6 +64,7 @@
 
 class W_MyType(W_MyObject):
     name = "foobar"
+    flag_map_or_seq = '?'
 
     def __init__(self):
         self.mro_w = [w_some_obj(), w_some_obj()]
diff --git a/pypy/objspace/std/listobject.py b/pypy/objspace/std/listobject.py
--- a/pypy/objspace/std/listobject.py
+++ b/pypy/objspace/std/listobject.py
@@ -212,6 +212,13 @@
         storage = strategy.erase(list_f)
         return W_ListObject.from_storage_and_strategy(space, storage, strategy)
 
+    @staticmethod
+    def newlist_cpyext(space, list):
+        from pypy.module.cpyext.sequence import CPyListStrategy, CPyListStorage
+        strategy = space.fromcache(CPyListStrategy)
+        storage = strategy.erase(CPyListStorage(space, list))
+        return W_ListObject.from_storage_and_strategy(space, storage, strategy)
+
     def __repr__(self):
         """ representation for debugging purposes """
         return "%s(%s, %s)" % (self.__class__.__name__, self.strategy,
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to