diff options
author | jomo <github@jomo.tv> | 2015-03-15 05:00:04 +0100 |
---|---|---|
committer | jomo <github@jomo.tv> | 2015-03-15 05:00:04 +0100 |
commit | 4357c46085c6050b950fa1150dcc6a46d36bd818 (patch) | |
tree | 947c3c40670d7acbcc6d901514c17e92d8695aaa /pmtoggle.py | |
parent | 1db0ac4cd54b2c21760f878cf756976dab4b8508 (diff) |
copy dict keys before iterating
python doesn't like changing dicts while iterating over that dict
Diffstat (limited to 'pmtoggle.py')
-rw-r--r-- | pmtoggle.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pmtoggle.py b/pmtoggle.py index 91dbc0c..81634a3 100644 --- a/pmtoggle.py +++ b/pmtoggle.py @@ -47,7 +47,7 @@ def on_quit(event): uuid = uid(event.getPlayer()) if uuid in toggle_dict: del toggle_dict[uuid] - for pid in toggle_dict: + for pid in list(toggle_dict): if toggle_dict[pid] == uuid: del toggle_dict[pid] msg(Bukkit.getPlayer(juuid(pid)), "%s &cwent off so your Private Message Toggle has been disabled!" % Bukkit.getPlayer(juuid(uuid)).getDisplayName())
\ No newline at end of file |