Commit b9970de7 authored by Matti Picus's avatar Matti Picus
Browse files

translation fixes

--HG--
branch : memoryview-attributes
parent 8dc76d4c4aa3
...@@ -208,7 +208,8 @@ class W_Root(object): ...@@ -208,7 +208,8 @@ class W_Root(object):
def buffer_w(self, space, flags): def buffer_w(self, space, flags):
w_impl = space.lookup(self, '__buffer__') w_impl = space.lookup(self, '__buffer__')
if w_impl is not None: if w_impl is not None:
w_result = space.get_and_call_function(w_impl, self, flags) w_result = space.get_and_call_function(w_impl, self,
space.newint(flags))
if space.isinstance_w(w_result, space.w_buffer): if space.isinstance_w(w_result, space.w_buffer):
return w_result.buffer_w(space, flags) return w_result.buffer_w(space, flags)
raise BufferInterfaceNotFound raise BufferInterfaceNotFound
...@@ -217,7 +218,7 @@ class W_Root(object): ...@@ -217,7 +218,7 @@ class W_Root(object):
w_impl = space.lookup(self, '__buffer__') w_impl = space.lookup(self, '__buffer__')
if w_impl is not None: if w_impl is not None:
w_result = space.get_and_call_function(w_impl, self, w_result = space.get_and_call_function(w_impl, self,
space.BUF_FULL_RO) space.newint(space.BUF_FULL_RO))
if space.isinstance_w(w_result, space.w_buffer): if space.isinstance_w(w_result, space.w_buffer):
return w_result.readbuf_w(space) return w_result.readbuf_w(space)
raise BufferInterfaceNotFound raise BufferInterfaceNotFound
...@@ -226,7 +227,7 @@ class W_Root(object): ...@@ -226,7 +227,7 @@ class W_Root(object):
w_impl = space.lookup(self, '__buffer__') w_impl = space.lookup(self, '__buffer__')
if w_impl is not None: if w_impl is not None:
w_result = space.get_and_call_function(w_impl, self, w_result = space.get_and_call_function(w_impl, self,
space.BUF_FULL) space.newint(space.BUF_FULL))
if space.isinstance_w(w_result, space.w_buffer): if space.isinstance_w(w_result, space.w_buffer):
return w_result.writebuf_w(space) return w_result.writebuf_w(space)
raise BufferInterfaceNotFound raise BufferInterfaceNotFound
...@@ -235,7 +236,7 @@ class W_Root(object): ...@@ -235,7 +236,7 @@ class W_Root(object):
w_impl = space.lookup(self, '__buffer__') w_impl = space.lookup(self, '__buffer__')
if w_impl is not None: if w_impl is not None:
w_result = space.get_and_call_function(w_impl, self, w_result = space.get_and_call_function(w_impl, self,
space.BUF_FULL_RO) space.newint(space.BUF_FULL_RO))
if space.isinstance_w(w_result, space.w_buffer): if space.isinstance_w(w_result, space.w_buffer):
return w_result.charbuf_w(space) return w_result.charbuf_w(space)
raise BufferInterfaceNotFound raise BufferInterfaceNotFound
......
...@@ -348,10 +348,7 @@ def wrap_getbuffer(space, w_self, w_args, func): ...@@ -348,10 +348,7 @@ def wrap_getbuffer(space, w_self, w_args, func):
with lltype.scoped_alloc(Py_buffer) as pybuf: with lltype.scoped_alloc(Py_buffer) as pybuf:
_flags = 0 _flags = 0
if space.len_w(w_args) > 0: if space.len_w(w_args) > 0:
_flags = space.listview(w_args)[0] _flags = space.int_w(space.listview(w_args)[0])
if not isinstance(_flags, int):
raise oefmt(space.w_TypeError,
"non-int flags passed to getbufferproc")
flags = rffi.cast(rffi.INT_real,_flags) flags = rffi.cast(rffi.INT_real,_flags)
size = generic_cpy_call(space, func_target, w_self, pybuf, flags) size = generic_cpy_call(space, func_target, w_self, pybuf, flags)
if widen(size) < 0: if widen(size) < 0:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment