diff --git a/klippy/klippy.py b/klippy/klippy.py index 42865b9bf..f28453772 100644 --- a/klippy/klippy.py +++ b/klippy/klippy.py @@ -210,7 +210,7 @@ def _build_protocol_error_message(self, e): msg_update = [] msg_updated = [] - for n, mcu_obj in self.lookup_objects("mcu"): + for mcu_name, mcu_obj in self.lookup_objects("mcu"): try: mcu_version = mcu_obj.get_status()["mcu_version"] except: @@ -220,15 +220,21 @@ def _build_protocol_error_message(self, e): if mcu_version != host_version: msg_update.append( "%s: Current version %s" - % (n.split()[-1], mcu_obj.get_status()["mcu_version"]) + % ( + mcu_name.split()[-1], + mcu_obj.get_status()["mcu_version"], + ) ) else: msg_updated.append( "%s: Current version %s" - % (n.split()[-1], mcu_obj.get_status()["mcu_version"]) + % ( + mcu_name.split()[-1], + mcu_obj.get_status()["mcu_version"], + ) ) - if len(msg_updated) == 0: + if not len(msg_updated): msg_updated.append("") version_msg = [