mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-27 18:45:05 +08:00
🐛 fix absolute import
This commit is contained in:
parent
2fe01f33e0
commit
ceebe0e95d
@ -189,7 +189,11 @@ class PluginManager:
|
|||||||
for path in paths:
|
for path in paths:
|
||||||
try:
|
try:
|
||||||
rel_path = Path(origin_path).relative_to(path)
|
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:
|
except ValueError:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user