Author: Matti Picus <matti.pi...@gmail.com>
Branch: 
Changeset: r94570:a8e6b2583cbc
Date: 2018-05-14 14:39 +0300
http://bitbucket.org/pypy/pypy/changeset/a8e6b2583cbc/

Log:    fix test for python3, remove implemented functions from stubs.py

diff --git a/pypy/module/cpyext/stubs.py b/pypy/module/cpyext/stubs.py
--- a/pypy/module/cpyext/stubs.py
+++ b/pypy/module/cpyext/stubs.py
@@ -1261,13 +1261,6 @@
     version indicates the file format."""
     raise NotImplementedError
 
-@cpython_api([PyObject, rffi.INT_real], PyObject)
-def PyMarshal_WriteObjectToString(space, value, version):
-    """Return a string object containing the marshalled representation of 
value.
-
-    version indicates the file format."""
-    raise NotImplementedError
-
 @cpython_api([FILE], lltype.Signed, error=CANNOT_FAIL)
 def PyMarshal_ReadLongFromFile(space, file):
     """Return a C long from the data stream in a FILE* opened
@@ -1301,17 +1294,6 @@
     (EOFError or TypeError) and returns NULL."""
     raise NotImplementedError
 
-@cpython_api([rffi.CCHARP, Py_ssize_t], PyObject)
-def PyMarshal_ReadObjectFromString(space, string, len):
-    """Return a Python object from the data stream in a character buffer
-    containing len bytes pointed to by string.  On error, sets the
-    appropriate exception (EOFError or TypeError) and returns
-    NULL.
-
-    This function used an int type for len. This might require
-    changes in your code for properly supporting 64-bit systems."""
-    raise NotImplementedError
-
 @cpython_api([], rffi.INT_real, error=CANNOT_FAIL)
 def PyMethod_ClearFreeList(space):
     """Clear the free list. Return the total number of freed items.
diff --git a/pypy/module/cpyext/test/test_marshal.py 
b/pypy/module/cpyext/test/test_marshal.py
--- a/pypy/module/cpyext/test/test_marshal.py
+++ b/pypy/module/cpyext/test/test_marshal.py
@@ -6,8 +6,8 @@
         module = self.import_extension('foo', [
             ("mloads", "METH_O",
              """
-                 char *input = PyString_AsString(args);
-                 Py_ssize_t length = PyString_Size(args);
+                 char *input = PyBytes_AsString(args);
+                 Py_ssize_t length = PyBytes_Size(args);
                  return PyMarshal_ReadObjectFromString(input, length);
              """)],
             prologue='#include <marshal.h>')
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to