diff options
Diffstat (limited to 'backend/src/loader.py')
| -rw-r--r-- | backend/src/loader.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/backend/src/loader.py b/backend/src/loader.py index e59cbcaf..c5c4bd8d 100644 --- a/backend/src/loader.py +++ b/backend/src/loader.py @@ -5,7 +5,7 @@ from logging import getLogger from os import listdir, path from pathlib import Path from traceback import print_exc -from typing import Any, Tuple +from typing import Any, Tuple, cast from aiohttp import web from os.path import exists @@ -38,7 +38,7 @@ class FileChangeHandler(RegexMatchingEventHandler): self.queue.put_nowait((path.join(self.plugin_path, plugin_dir, "main.py"), plugin_dir, True)) def on_created(self, event: DirCreatedEvent | FileCreatedEvent): - src_path = event.src_path + src_path = cast(str, event.src_path) #type: ignore # this is the correct type for this is in later versions of watchdog if "__pycache__" in src_path: return @@ -52,7 +52,7 @@ class FileChangeHandler(RegexMatchingEventHandler): self.maybe_reload(src_path) def on_modified(self, event: DirModifiedEvent | FileModifiedEvent): - src_path = event.src_path + src_path = cast(str, event.src_path) # type: ignore if "__pycache__" in src_path: return @@ -235,4 +235,4 @@ class Loader: await self.reload_queue.put((plugin.file, plugin.plugin_directory)) - return web.Response(status=200)
\ No newline at end of file + return web.Response(status=200) |
