Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNT: remove Python2 only code #1916

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions zmq/backend/cython/_zmq.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,26 +371,6 @@ def __getbuffer__(self, buffer: pointer(Py_buffer), flags: C.int): # noqa: F821
buffer.itemsize = 1
buffer.internal = NULL

def __getsegcount__(self, lenp: pointer(Py_ssize_t)) -> C.int:
# required for getreadbuffer
if lenp != NULL:
lenp[0] = zmq_msg_size(address(self.zmq_msg))
return 1

def __getreadbuffer__(self, idx: Py_ssize_t, p: pointer(p_void)) -> Py_ssize_t:
# old-style (buffer) interface
data_c: p_char = NULL
data_len_c: Py_ssize_t
if idx != 0:
raise SystemError("accessing non-existent buffer segment")
# read-only, because we don't want to allow
# editing of the message in-place
data_c = cast(p_char, zmq_msg_data(address(self.zmq_msg)))
data_len_c = zmq_msg_size(address(self.zmq_msg))
if p != NULL:
p[0] = cast(p_void, data_c)
return data_len_c

def __len__(self) -> size_t:
"""Return the length of the message in bytes."""
sz: size_t = zmq_msg_size(address(self.zmq_msg))
Expand Down