Skip to content

Fix Bot.run startup on Python 3.14 when no current event loop exists#246

Merged
TWT233 merged 1 commit into
TWT233:mainfrom
Nixer-2301:main
Jul 3, 2026
Merged

Fix Bot.run startup on Python 3.14 when no current event loop exists#246
TWT233 merged 1 commit into
TWT233:mainfrom
Nixer-2301:main

Conversation

@Nixer-2301

Copy link
Copy Markdown
Contributor

On Python 3.14, asyncio.get_event_loop() raises RuntimeError when no
current event loop exists in the main thread. Bot.run() calls it at startup
and crashes immediately.

This change keeps the existing code path on older Python versions and only
creates/sets a new event loop when get_event_loop() fails.

Before
bot.run() → RuntimeError before reaching start()

After
bot.run() → proceeds past loop init → reaches start()

@TWT233 TWT233 merged commit 12470dc into TWT233:main Jul 3, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants