mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-27 16:21:28 +00:00
🐛 fix absolute import
This commit is contained in:
@ -189,7 +189,11 @@ class PluginManager:
|
||||
for path in paths:
|
||||
try:
|
||||
rel_path = Path(origin_path).relative_to(path)
|
||||
return ".".join(rel_path.parts[:-1] + (rel_path.stem,))
|
||||
if rel_path.stem == "__init__":
|
||||
return f"{self.internal_module.__name__}." + ".".join(
|
||||
rel_path.parts[:-1])
|
||||
return f"{self.internal_module.__name__}." + ".".join(
|
||||
rel_path.parts[:-1] + (rel_path.stem,))
|
||||
except ValueError:
|
||||
continue
|
||||
|
||||
|
Reference in New Issue
Block a user