Author: Amaury Forgeot d'Arc <[email protected]>
Branch: py3k
Changeset: r59054:366f4acf8509
Date: 2012-11-22 22:46 +0100
http://bitbucket.org/pypy/pypy/changeset/366f4acf8509/
Log: cpyext: PyUnicode_AsWideCharString() now takes a PyObject*, not a
PyUnicodeObject*
diff --git a/pypy/module/cpyext/unicodeobject.py
b/pypy/module/cpyext/unicodeobject.py
--- a/pypy/module/cpyext/unicodeobject.py
+++ b/pypy/module/cpyext/unicodeobject.py
@@ -245,7 +245,7 @@
w_obj = from_ref(space, ref)
return space.len_w(w_obj)
-@cpython_api([PyUnicodeObject, rffi.CWCHARP, Py_ssize_t], Py_ssize_t, error=-1)
+@cpython_api([PyObject, rffi.CWCHARP, Py_ssize_t], Py_ssize_t, error=-1)
def PyUnicode_AsWideChar(space, ref, buf, size):
"""Copy the Unicode object contents into the wchar_t buffer w. At most
size wchar_t characters are copied (excluding a possibly trailing
@@ -254,7 +254,7 @@
string may or may not be 0-terminated. It is the responsibility of the
caller
to make sure that the wchar_t string is 0-terminated in case this is
required by the application."""
- c_buffer = PyUnicode_AS_UNICODE(space, rffi.cast(PyObject, ref))
+ c_buffer = PyUnicode_AS_UNICODE(space, ref)
c_size = ref.c_size
# If possible, try to copy the 0-termination as well
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit