diff options
author | Matti Picus <matti.picus@gmail.com> | 2020-09-11 10:50:40 +0300 |
---|---|---|
committer | Matti Picus <matti.picus@gmail.com> | 2020-09-11 10:50:40 +0300 |
commit | 9352adc7872025ebfc3c5d57e6b755afe0ce5721 (patch) | |
tree | ee571f22fe638833b1236237fd038e68f2944925 | |
parent | add latest changes to release note (diff) | |
download | pypy-9352adc7872025ebfc3c5d57e6b755afe0ce5721.tar.gz pypy-9352adc7872025ebfc3c5d57e6b755afe0ce5721.tar.bz2 pypy-9352adc7872025ebfc3c5d57e6b755afe0ce5721.zip |
fix translation
-rw-r--r-- | pypy/module/cpyext/memoryobject.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pypy/module/cpyext/memoryobject.py b/pypy/module/cpyext/memoryobject.py index be7ad524c9..5cae2d920e 100644 --- a/pypy/module/cpyext/memoryobject.py +++ b/pypy/module/cpyext/memoryobject.py @@ -261,6 +261,7 @@ def PyMemoryView_GetContiguous(space, w_obj, buffertype, order): 'F'ortran order otherwise. """ + buffertype = widen(buffertype) if buffertype != PyBUF_READ and buffertype != PyBUF_WRITE: raise oefmt(space.w_ValueError, "buffertype must be PyBUF_READ or PyBUF_WRITE") @@ -273,7 +274,7 @@ def PyMemoryView_GetContiguous(space, w_obj, buffertype, order): mv = make_ref(space, w_mv) mv = rffi.cast(PyMemoryViewObject, mv) view = mv.c_view - if buffertype == PyBUF_WRITE and view.c_readonly: + if buffertype == PyBUF_WRITE and widen(view.c_readonly): raise oefmt(space.w_BufferError, "underlying buffer is not writable") |