Skip to content

Commit

Permalink
Only import SirRobin in __init__ if type checking
Browse files Browse the repository at this point in the history
This ensure logging is setup properly at runtime before importing additional modules
  • Loading branch information
ChrisLovering committed Nov 30, 2024
1 parent c8500b9 commit 500ac2b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import asyncio
import os
from typing import TYPE_CHECKING

from pydis_core.utils import apply_monkey_patches

from bot.bot import SirRobin
from bot.log import setup_logging

if TYPE_CHECKING:
from bot.bot import SirRobin

# On Windows, the selector event loop is required for aiodns.
if os.name == "nt":
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
Expand Down

0 comments on commit 500ac2b

Please sign in to comment.