diff --git a/VW_Flash_GUI.py b/VW_Flash_GUI.py index 9c50290..7a55ce9 100644 --- a/VW_Flash_GUI.py +++ b/VW_Flash_GUI.py @@ -719,9 +719,9 @@ def on_stop_logger(self, event): def ble_scan_callback(self, interfaces): self.panel.interfaces += interfaces dialog_interfaces = [] - for i in range(len(self.panel.interfaces)): - if(self.panel.interfaces[i][0] is not None): - dialog_interfaces.append(self.panel.interfaces[i][0]) + self.panel.interfaces = list(filter(lambda interface: interface[0] is not None, self.panel.interfaces)) + for interface in self.panel.interfaces: + dialog_interfaces.append(interface[0]) dlg = wx.SingleChoiceDialog( self, "Select an Interface", "Select an interface", dialog_interfaces )