File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -182,10 +182,13 @@ def do(self) -> None:
182182 class DirectionIndicatorSound (FrequencyGenerator ):
183183 @_override
184184 def do (self ) -> None :
185- if self ._loops % 2 == 1 :
186- DIRECTION_INDICATOR_ON .play ()
187- else :
188- DIRECTION_INDICATOR_OFF .play ()
185+ try :
186+ if self ._loops % 2 == 1 :
187+ DIRECTION_INDICATOR_ON .play ()
188+ else :
189+ DIRECTION_INDICATOR_OFF .play ()
190+ except RuntimeError as e :
191+ L .error (repr (e ))
189192
190193 def render (manager : ContextManager ) -> None :
191194 m1_widgets = (
@@ -227,7 +230,10 @@ def render(manager: ContextManager) -> None:
227230
228231 def time_lap () -> None :
229232 ctx .time_lap ()
230- CONFIRM .play ()
233+ try :
234+ CONFIRM .play ()
235+ except RuntimeError as e :
236+ L .error (repr (e ))
231237
232238 manager ["time_lap" ] = _Button (root , text = "" , image = Stopwatch (), command = time_lap )
233239 manager ["hazard" ] = _Button (root , text = "" , image = Hazard (), command = lambda : ctx .hazard (not ctx .hazard ()))
@@ -237,7 +243,10 @@ def switch_esc_mode(mode: str) -> None:
237243 manager ["esc" ].configure (selected_color = "green" , selected_hover_color = "green" )
238244 else :
239245 manager ["esc" ].configure (selected_color = "red" , selected_hover_color = "red" )
240- WARNING .play ()
246+ try :
247+ WARNING .play ()
248+ except RuntimeError as e :
249+ L .error (repr (e ))
241250 ctx .esc_mode (esc_mode )
242251 w .runtime_data ().control_system_switch_changed = True
243252
You can’t perform that action at this time.
0 commit comments