Skip to content

Commit e4dd540

Browse files
committed
don't check closed-ness via zmq if possible
1 parent 670f08e commit e4dd540

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/zmq_anyio/_socket.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,8 @@ async def wait_or_cancel() -> None:
899899
tg.cancel_scope.cancel()
900900

901901
def fileno() -> int:
902+
if self.closed:
903+
return -1
902904
try:
903905
return self._shadow_sock.fileno()
904906
except zmq.ZMQError:

0 commit comments

Comments
 (0)