Author: Ronan Lamy <ronan.l...@gmail.com> Branch: PyBuffer Changeset: r90891:d8147a9479bc Date: 2017-04-01 02:13 +0100 http://bitbucket.org/pypy/pypy/changeset/d8147a9479bc/
Log: Fix PyBuffer/BinaryBuffer confusion in _cffi_backend diff --git a/pypy/module/_cffi_backend/cbuffer.py b/pypy/module/_cffi_backend/cbuffer.py --- a/pypy/module/_cffi_backend/cbuffer.py +++ b/pypy/module/_cffi_backend/cbuffer.py @@ -79,20 +79,20 @@ if space.isinstance_w(w_other, space.w_unicode): return space.w_NotImplemented try: - other_buf = space.buffer_w(w_other, space.BUF_SIMPLE) + other_pybuf = space.buffer_w(w_other, space.BUF_SIMPLE) except OperationError as e: if e.async(space): raise return space.w_NotImplemented my_buf = self.buffer my_len = len(my_buf) - other_len = len(other_buf) + other_len = other_pybuf.getlength() if other_len != my_len: if mode == 'E': return space.w_False if mode == 'N': return space.w_True - cmp = _memcmp(my_buf, other_buf, min(my_len, other_len)) + cmp = _memcmp(my_buf, other_pybuf.as_binary(), min(my_len, other_len)) if cmp == 0: if my_len < other_len: cmp = -1 _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit