diff --git a/src/client.py b/src/client.py index 79c5eec..7c478f1 100644 --- a/src/client.py +++ b/src/client.py @@ -298,7 +298,7 @@ class Client(Base): resources = socket.getaddrinfo(host, port, socket.AF_UNSPEC, socket.SOCK_STREAM, socket.IPPROTO_TCP) for res in resources: - af, socktype, proto, canonname, sa = res + af, socktype, proto, _, sa = res try: sock = socket.socket(af, socktype, proto) sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) @@ -754,7 +754,6 @@ class Client(Base): data = None size = 1 offset = 0 - index = 0 # Read data until size is reached while offset < size: @@ -775,7 +774,7 @@ class Client(Base): self._logger.debug("size: %d", size) # For some commands the second line is the mimetype if has_mimetype: - mimetype = self._parse_dict([self._read_line()])['type'] + self._parse_dict([self._read_line()])['type'] # Next line is the count of bytes read binary = int(self._parse_dict([self._read_line()])['binary']) self._logger.debug("binary: %d", binary) @@ -1148,7 +1147,7 @@ class MCGTrack: if date_string: try: self._last_modified = dateutil.parser.isoparse(date_string) - except ValueError as e: + except ValueError: self._logger.debug("Invalid date format: %s", date_string) def get_last_modified(self): diff --git a/src/coverpanel.py b/src/coverpanel.py index 803e1a4..89a6388 100644 --- a/src/coverpanel.py +++ b/src/coverpanel.py @@ -152,7 +152,7 @@ class CoverPanel(Gtk.Overlay): # Load image and draw it try: self._cover_pixbuf = Utils.load_pixbuf(data) - except Exception as e: + except Exception: self._logger.exception("Failed to set albumart") self._cover_pixbuf = None else: diff --git a/src/librarypanel.py b/src/librarypanel.py index f595d4e..cc4ecc2 100644 --- a/src/librarypanel.py +++ b/src/librarypanel.py @@ -297,7 +297,7 @@ class LibraryPanel(Adw.Bin): # Load image and draw it try: self._standalone_pixbuf = Utils.load_pixbuf(data) - except Exception as e: + except Exception: self._logger.exception("Failed to set albumart") self._standalone_pixbuf = self._get_default_image() else: diff --git a/src/playlistpanel.py b/src/playlistpanel.py index 1365b32..920b1bb 100644 --- a/src/playlistpanel.py +++ b/src/playlistpanel.py @@ -175,7 +175,7 @@ class PlaylistPanel(Adw.Bin): # Load image and draw it try: self._standalone_pixbuf = Utils.load_pixbuf(data) - except Exception as e: + except Exception: self._logger.exception("Failed to set albumart") self._cover_pixbuf = self._get_default_image() else: diff --git a/src/serverpanel.py b/src/serverpanel.py index be7bd97..aceaa60 100644 --- a/src/serverpanel.py +++ b/src/serverpanel.py @@ -103,8 +103,8 @@ class ServerPanel(Adw.Bin): button = Gtk.CheckButton.new_with_label(device.get_name()) if device.is_enabled(): button.set_active(True) - handler = button.connect('toggled', - self.on_output_device_toggled, device) + button.connect('toggled', self.on_output_device_toggled, + device) self.output_devices.insert(button, -1) self._output_buttons[device.get_id()] = button