From b0c011c70c6a0520dc9382480c7a05bf8c46e8d7 Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Thu, 28 Feb 2019 00:27:50 +0300 Subject: [PATCH] Fix plugins import on windows (#223) Fixes #217 --- pyrogram/client/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index f62c046c..ae8ed111 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -1139,7 +1139,7 @@ class Client(Methods, BaseClient): if include is None: for path in sorted(Path(root).rglob("*.py")): - module_path = os.path.splitext(str(path))[0].replace("/", ".") + module_path = '.'.join(path.parent.parts + (path.stem,)) module = import_module(module_path) for name in vars(module).keys():