Skip to content

Commit 6e34994

Browse files
fix: use pathlib to determine module name
1 parent 8be2332 commit 6e34994

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modmail/addons/plugins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def walk_plugin_files(
314314

315315
# calculate the module name, dervived from the relative path
316316
relative_path = pathlib.Path(path).relative_to(BASE_PLUGIN_PATH)
317-
module_name = relative_path.__str__().rstrip(".py").replace("/", ".")
317+
module_name = ".".join(relative_path.parent.parts) + "." + relative_path.stem
318318
module_name = plugins.__name__ + "." + module_name
319319
logger.trace(f"{module_name =}")
320320

0 commit comments

Comments
 (0)