fix(hotreload): use 3.8-compatible typehints
Some checks failed
Actions / Build Documentation (MkDocs) (push) Successful in 44s
Actions / Lint Code (Ruff & Pylint) (push) Failing after 50s

This commit is contained in:
cswimr 2025-01-26 21:31:48 +00:00
parent 5c6783452d
commit 289da84b76
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087

View file

@ -1,6 +1,6 @@
from asyncio import run_coroutine_threadsafe
from pathlib import Path
from typing import TYPE_CHECKING, Sequence
from typing import TYPE_CHECKING, List, Sequence, Tuple
from red_commons.logging import RedTraceLogger, getLogger
from redbot.core import Config, checks, commands
@ -19,7 +19,7 @@ class HotReload(commands.Cog):
__author__ = ["[cswimr](https://www.coastalcommits.com/cswimr)"]
__git__ = "https://www.coastalcommits.com/cswimr/SeaCogs"
__version__ = "1.3.2"
__version__ = "1.3.3"
__documentation__ = "https://seacogs.coastalcommits.com/hotreload/"
def __init__(self, bot: Red) -> None:
@ -27,7 +27,7 @@ class HotReload(commands.Cog):
self.bot: Red = bot
self.config = Config.get_conf(self, identifier=294518358420750336, force_registration=True)
self.logger: RedTraceLogger = getLogger(name="red.SeaCogs.HotReload")
self.observers: list[ObserverType] = []
self.observers: List[ObserverType] = []
self.config.register_global(notify_channel=None)
watchdog_loggers = [getLogger(name="watchdog.observers.inotify_buffer")]
for watchdog_logger in watchdog_loggers:
@ -55,7 +55,7 @@ class HotReload(commands.Cog):
]
return "\n".join(text)
async def get_paths(self) -> tuple[Path]:
async def get_paths(self) -> Tuple[Path]:
"""Retrieve user defined paths."""
cog_manager = self.bot._cog_mgr # noqa: SLF001 # We have to use this private method because there is no public API to get user defined paths
cog_paths = await cog_manager.user_defined_paths()