del not .remove on dicts

This commit is contained in:
Firepup Sixfifty 2024-07-15 23:37:15 +00:00
parent 8be3808fce
commit a31810ab46
Signed by: Firepup650
SSH key fingerprint: SHA256:U0Zp8EhEe3CMqFSrC79CqatzaEiL4sjta80/RSX2XrY

View file

@ -477,7 +477,7 @@ async def connectServer(hostname: str, port: int):
G.msgs.append(log(f"{cName}'s server is going down"))
G.clientsConnected.remove(cName.lower())
G.serverLinks -= 1
G.servers.remove(rID)
del G.servers[rID]
G.msgs.append(log(f"{rID} has de-linked from the network"))
except (ConnectionResetError, BrokenPipeError, IndexError):
for cName in G.servers[rID]:
@ -487,7 +487,7 @@ async def connectServer(hostname: str, port: int):
except Exception:
pass
G.serverLinks -= 1
G.servers.remove(rID)
del G.servers[rID]
G.msgs.append(log(f"{rID} has de-linked from the network"))