Skip to content

Commit

Permalink
Fixed a small issue i was facing with create_console
Browse files Browse the repository at this point in the history
Made it iterate through a copy of the dictionary rather than the dictionary object itself. This prevents crashing on looping through the dictionary while it can change.
  • Loading branch information
dly2424 authored Mar 5, 2022
1 parent e6da18a commit 1a767bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion py_tale.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ async def create_console(self, server_id, body='{"should_launch":"false","ignore
else:
raise Exception(f"Server {server_id} connection rejected. Could not gather data with request_server_by_id.")
if len(self.main_subscriptions) != 0:
for iterate in self.main_subscriptions: # {sub:{"callbacks":[callbacks], "fullname":"Fullnamehere"}}
for iterate in dict(self.main_subscriptions): # {sub:{"callbacks":[callbacks], "fullname":"Fullnamehere"}}
if f"subscription/group-server-status/{group_id}" in self.main_subscriptions[iterate]["fullname"]:
if self.ensure_console not in self.main_subscriptions[iterate]["callbacks"]:
await self.main_sub(f"subscription/group-server-status/{group_id}", self.ensure_console)
Expand Down

0 comments on commit 1a767bf

Please sign in to comment.