Skip to content

Commit

Permalink
src: Bot: Guard the platform-specific attribute of the asyncio package
Browse files Browse the repository at this point in the history
  • Loading branch information
prathamdby committed Mar 26, 2024
1 parent 5ce4169 commit 62d66b7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ def main() -> None:
default_event_loop_policy = asyncio.get_event_loop_policy()
import g4f # Trigger g4f event loop policy set # noqa: F401 # pylint: disable=unused-import # isort:skip

if isinstance(asyncio.get_event_loop_policy(), asyncio.WindowsSelectorEventLoopPolicy):
asyncio.set_event_loop_policy(default_event_loop_policy)
if hasattr(asyncio, "WindowsSelectorEventLoopPolicy"):
if isinstance(asyncio.get_event_loop_policy(), asyncio.WindowsSelectorEventLoopPolicy):
asyncio.set_event_loop_policy(default_event_loop_policy)

loaded_modules = load_modules(app)
app.run()

0 comments on commit 62d66b7

Please sign in to comment.