7
7
8
8
import zmq
9
9
from zmq .constants import SocketOption , _OptType
10
- from zmq .error import ZMQError , _check_rc , _check_version
10
+ from zmq .error import ZMQError , _check_rc
11
11
12
12
from ._cffi import ffi
13
13
from ._cffi import lib as C
@@ -184,7 +184,6 @@ def bind(self, address):
184
184
_check_rc (rc )
185
185
186
186
def unbind (self , address ):
187
- _check_version ((3 , 2 ), "unbind" )
188
187
if isinstance (address , str ):
189
188
address = address .encode ('utf8' )
190
189
rc = C .zmq_unbind (self ._zmq_socket , address )
@@ -197,7 +196,6 @@ def connect(self, address):
197
196
_check_rc (rc )
198
197
199
198
def disconnect (self , address ):
200
- _check_version ((3 , 2 ), "disconnect" )
201
199
if isinstance (address , str ):
202
200
address = address .encode ('utf8' )
203
201
rc = C .zmq_disconnect (self ._zmq_socket , address )
@@ -340,9 +338,9 @@ def recv(self, flags=0, copy=True, track=False):
340
338
def recv_into (self , buffer , / , * , nbytes : int = 0 , flags : int = 0 ) -> int :
341
339
view = memoryview (buffer )
342
340
if not view .contiguous :
343
- raise ValueError ("Can only recv_into contiguous buffers" )
341
+ raise BufferError ("Can only recv_into contiguous buffers" )
344
342
if view .readonly :
345
- raise ValueError ("Cannot recv_into readonly buffer" )
343
+ raise BufferError ("Cannot recv_into readonly buffer" )
346
344
if nbytes < 0 :
347
345
raise ValueError (f"{ nbytes = } must be non-negative" )
348
346
view_bytes = view .nbytes
@@ -372,8 +370,6 @@ def monitor(self, addr, events=-1):
372
370
events : int [default: zmq.EVENT_ALL]
373
371
The zmq event bitmask for which events will be sent to the monitor.
374
372
"""
375
-
376
- _check_version ((3 , 2 ), "monitor" )
377
373
if events < 0 :
378
374
events = zmq .EVENT_ALL
379
375
if addr is None :
0 commit comments