Skip to content
Open
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
2 changes: 1 addition & 1 deletion zmq/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def _clear_io_state(self):
called once at close
"""
loop = self._current_loop
if loop and not loop.is_closed() and self._fd != -1:
if loop and not loop.is_closed():
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐞 Bug - Invalid File Descriptor: Restore the self._fd != -1 check in the condition to ensure only valid file descriptors are passed to remove_reader(), or add explicit validation before calling remove_reader().

Suggested change
if loop and not loop.is_closed():
if loop and not loop.is_closed() and self._fd != -1:

self._get_selector(loop).remove_reader(self._fd)


Expand Down