[pypy-commit] pypy utf8-unicode2: Mostly fix _cffi_backend on Windows
waedt
noreply at buildbot.pypy.org
Sat Sep 6 22:45:11 CEST 2014
Author: Tyler Wade <wayedt at gmail.com>
Branch: utf8-unicode2
Changeset: r73349:039ddc451153
Date: 2014-08-29 00:00 -0500
http://bitbucket.org/pypy/pypy/changeset/039ddc451153/
Log: Mostly fix _cffi_backend on Windows
diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -10,6 +10,7 @@
from rpython.rlib.rarithmetic import r_uint, SHRT_MIN, SHRT_MAX, \
INT_MIN, INT_MAX, UINT_MAX
+from pypy.interpreter import utf8
from pypy.interpreter.utf8 import Utf8Str
from pypy.interpreter.executioncontext import (ExecutionContext, ActionFlag,
UserDelAction)
@@ -1567,7 +1568,7 @@
"Like unicode_w, but rejects strings with NUL bytes."
from rpython.rlib import rstring
result = w_obj.unicode_w(self)
- if Utf8Str('\x00') in result:
+ if utf8.IN('\00', result):
raise OperationError(self.w_TypeError, self.wrap(
'argument must be a unicode string without NUL characters'))
return rstring.assert_str0(result)
diff --git a/pypy/module/_cffi_backend/ctypeptr.py b/pypy/module/_cffi_backend/ctypeptr.py
--- a/pypy/module/_cffi_backend/ctypeptr.py
+++ b/pypy/module/_cffi_backend/ctypeptr.py
@@ -101,10 +101,10 @@
"initializer unicode string is too long for '%s' "
"(got %d characters)", self.name, n)
- unichardata = rffi.cast(utf8.WCHAR_INTP, cdata)
+ unichardata = rffi.cast(utf8.WCHAR_UINTP, cdata)
s.copy_to_wcharp(unichardata, 0, n)
if n != self.length:
- unichardata[n] = utf8.wchar_rint(0)
+ unichardata[n] = utf8.wchar_ruint(0)
else:
raise self._convert_error("list or tuple", w_ob)
More information about the pypy-commit
mailing list