[pypy-commit] pypy py3.5: Use rffi.getintfield(). Fixes one translation error

arigo pypy.commits at gmail.com
Sun Mar 5 04:01:58 EST 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: py3.5
Changeset: r90555:f72cc14bf6c6
Date: 2017-03-05 09:58 +0100
http://bitbucket.org/pypy/pypy/changeset/f72cc14bf6c6/

Log:	Use rffi.getintfield(). Fixes one translation error

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
@@ -103,19 +103,19 @@
     return py_obj.c_state
 
 def get_kind(py_obj):
-    return get_state(py_obj).c_kind
+    return rffi.getintfield(get_state(py_obj), 'c_kind')
 
 def set_kind(py_obj, value):
     get_state(py_obj).c_kind = cts.cast('unsigned int', value)
 
 def get_ascii(py_obj):
-    return get_state(py_obj).c_ascii
+    return rffi.getintfield(get_state(py_obj), 'c_ascii')
 
 def set_ascii(py_obj, value):
     get_state(py_obj).c_ascii = cts.cast('unsigned int', value)
 
 def get_ready(py_obj):
-    return get_state(py_obj).c_ready
+    return rffi.getintfield(get_state(py_obj), 'c_ready')
 
 def set_ready(py_obj, value):
     get_state(py_obj).c_ready = cts.cast('unsigned int', value)
@@ -262,7 +262,7 @@
 def _PyUnicode_Ready(space, w_obj):
     assert isinstance(w_obj, unicodeobject.W_UnicodeObject)
     py_obj = as_pyobj(space, w_obj)
-    assert widen(get_kind(py_obj)) == WCHAR_KIND
+    assert get_kind(py_obj) == WCHAR_KIND
     maxchar = 0
     for c in w_obj._value:
         if ord(c) > maxchar:


More information about the pypy-commit mailing list