Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaswinkler committed Jun 21, 2024
1 parent 20b1935 commit 420178a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 7 additions & 5 deletions beetsplug/mbsubmit.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,12 @@ def _start_server(self) -> bool:
return True

if (port := self.create_release_server_port) == 0:
# Find a free port for us to use. The OS will select a random available one.
# We can't pass 0 to waitress.create_server directly, this won't work when
# using hostnames instead of IP addresses for
# create_release_server_hostname, waitress will then bind to multiple
# sockets, with different ports for each.
with socket.socket() as s:
# Find a free port for us to use. The OS will select a random available one.
# We can't pass 0 to waitress.create_server directly, this won't work when
# using hostnames instead of IP addresses for create_release_server_hostname,
# waitress will then bind to multiple sockets, with different ports for each.
s.bind((self.create_release_server_hostname, 0))
port = s.getsockname()[1]

Expand All @@ -359,7 +360,8 @@ def _start_server(self) -> bool:
return True
except (PermissionError, ValueError, OSError) as e:
self._log.error(
f"Failed to start internal web server on {self.create_release_server_hostname}:{port}: {str(e)}"
f"Failed to start internal web server on "
f"{self.create_release_server_hostname}:{port}: {str(e)}"
)
self._server = None
return False
Expand Down
1 change: 0 additions & 1 deletion test/plugins/test_mbsubmit.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
capture_stdout,
control_stdin,
)
from beetsplug import mbsubmit
from beetsplug.mbsubmit import CreateReleaseTask, MBSubmitPlugin


Expand Down

0 comments on commit 420178a

Please sign in to comment.