aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2020-09-11 10:50:40 +0300
committerMatti Picus <matti.picus@gmail.com>2020-09-11 10:50:40 +0300
commit9352adc7872025ebfc3c5d57e6b755afe0ce5721 (patch)
treeee571f22fe638833b1236237fd038e68f2944925
parentadd latest changes to release note (diff)
downloadpypy-9352adc7872025ebfc3c5d57e6b755afe0ce5721.tar.gz
pypy-9352adc7872025ebfc3c5d57e6b755afe0ce5721.tar.bz2
pypy-9352adc7872025ebfc3c5d57e6b755afe0ce5721.zip
fix translation
-rw-r--r--pypy/module/cpyext/memoryobject.py3
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")