Enclose dict key lookup in try-except block
Some recent changes moved the dictionary access outside try-except block again. Widen the block enough again.
This commit is contained in:
parent
9cade44472
commit
1d53e32f1e
|
@ -159,10 +159,10 @@ class HUD_main(object):
|
||||||
# function idle_func() to be run by the gui thread, at its leisure.
|
# function idle_func() to be run by the gui thread, at its leisure.
|
||||||
def idle_func():
|
def idle_func():
|
||||||
gtk.gdk.threads_enter()
|
gtk.gdk.threads_enter()
|
||||||
|
try:
|
||||||
self.hud_dict[table_name].update(new_hand_id, config)
|
self.hud_dict[table_name].update(new_hand_id, config)
|
||||||
# The HUD could get destroyed in the above call ^^, which leaves us with a KeyError here vv
|
# The HUD could get destroyed in the above call ^^, which leaves us with a KeyError here vv
|
||||||
# if we ever get an error we need to expect ^^ then we need to handle it vv - Eric
|
# if we ever get an error we need to expect ^^ then we need to handle it vv - Eric
|
||||||
try:
|
|
||||||
[aw.update_gui(new_hand_id) for aw in self.hud_dict[table_name].aux_windows]
|
[aw.update_gui(new_hand_id) for aw in self.hud_dict[table_name].aux_windows]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in New Issue
Block a user