Visitar URL original
Fix the configuration load process breaking in case of no plugins · stack-queue/pyrogram@a8a6f53 · GitHub
Skip to content

Commit a8a6f53

Browse files
committed
Fix the configuration load process breaking in case of no plugins
1 parent 5e97cb3 commit a8a6f53

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

‎pyrogram/client/client.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,14 +1087,15 @@ def load_config(self):
10871087
"exclude": section.get("exclude") or None
10881088
}
10891089
except KeyError:
1090-
pass
1090+
self.plugins = {}
10911091

1092-
for option in ["include", "exclude"]:
1093-
if self.plugins[option] is not None:
1094-
self.plugins[option] = [
1095-
(i.split()[0], i.split()[1:] or None)
1096-
for i in self.plugins[option].strip().split("\n")
1097-
]
1092+
if self.plugins:
1093+
for option in ["include", "exclude"]:
1094+
if self.plugins[option] is not None:
1095+
self.plugins[option] = [
1096+
(i.split()[0], i.split()[1:] or None)
1097+
for i in self.plugins[option].strip().split("\n")
1098+
]
10981099

10991100
def load_session(self):
11001101
try:

0 commit comments

Comments
 (0)