diff --git a/mpf/modes/high_score/code/high_score.py b/mpf/modes/high_score/code/high_score.py index 63ab9bdcb..23aa3f7bc 100644 --- a/mpf/modes/high_score/code/high_score.py +++ b/mpf/modes/high_score/code/high_score.py @@ -196,7 +196,8 @@ async def _run(self) -> None: # ask player for initials if we do not know them if not player.initials: try: - player.initials = await self._ask_player_for_initials(player, award_names[i], value, category_name) + player.initials = await self._ask_player_for_initials(player, award_names[i], + value, category_name) except asyncio.TimeoutError: del new_list[i] # no entry when the player missed the timeout diff --git a/mpf/platforms/fast/fast_exp_board.py b/mpf/platforms/fast/fast_exp_board.py index 78adffb41..98eab1619 100644 --- a/mpf/platforms/fast/fast_exp_board.py +++ b/mpf/platforms/fast/fast_exp_board.py @@ -2,6 +2,7 @@ import asyncio from base64 import b16decode +from binascii import Error as binasciiError from importlib import import_module from packaging import version @@ -176,7 +177,7 @@ def update_leds(self): try: self.communicator.send_bytes(b16decode(f'{msg_header}{msg}'), log_msg) - except Exception as e: + except binasciiError as e: self.log.error( f"Error decoding the following message for board {breakout_address} : {msg_header}{msg}") self.log.info("Attempted update that caused this error: %s", dirty_leds) diff --git a/mpf/plugins/platform_integration_test_runner.py b/mpf/plugins/platform_integration_test_runner.py index 2155d302e..bee98468c 100644 --- a/mpf/plugins/platform_integration_test_runner.py +++ b/mpf/plugins/platform_integration_test_runner.py @@ -227,7 +227,7 @@ async def move_ball_from_drain_to_trough(self, **kwargs): drain_switches = self.machine.ball_devices.items_tagged('drain')[0].config.get('ball_switches') self.info_log("Found drain switches: %s of type %s", drain_switches, type(drain_switches)) # If there's only one drain switch it might be a single value, rather than a list - drain_switch = drain_switches if type(drain_switches) is str else drain_switches[-1] + drain_switch = drain_switches if isinstance(drain_switches, str) else drain_switches[-1] self.info_log("Setting drain switch '%s' to zero", drain_switch) self.set_switch_sync(drain_switch, 0) await asyncio.sleep(0.25)