Skip to content
Closed
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
3 changes: 3 additions & 0 deletions src/frequenz/channels/_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,9 @@ async def select( # noqa: DOC503
receivers_map: dict[str, Receiver[Any]] = {str(hash(r)): r for r in receivers}
pending: set[asyncio.Task[bool]] = set()

if asyncio.get_event_loop().is_closed():
Copy link

Copilot AI Jun 19, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider using 'asyncio.get_running_loop()' instead of 'asyncio.get_event_loop()' for improved clarity and compatibility with newer Python versions where a running loop is expected.

Suggested change
if asyncio.get_event_loop().is_closed():
if asyncio.get_running_loop().is_closed():

Copilot uses AI. Check for mistakes.
raise SelectError("Cannot select on a closed event loop")

try:
for name, recv in receivers_map.items():
pending.add(asyncio.create_task(recv.ready(), name=name))
Expand Down
Loading