Skip to content

Commit

Permalink
moved the port setting down to just reuse the later 'try' block becau…
Browse files Browse the repository at this point in the history
…se i wanted to be raising the error there anyways
  • Loading branch information
qwint committed Mar 18, 2024
1 parent a7a8fb3 commit 36d3913
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions CommonClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,16 +643,13 @@ async def server_loop(ctx: CommonContext, address: typing.Optional[str] = None)
ctx.username = server_url.username
if server_url.password:
ctx.password = server_url.password
try:
port = server_url.port or 38281
except ValueError as e:
logger.info("Given Port could not be converted into an Integer")

def reconnect_hint() -> str:
return ", type /connect to reconnect" if ctx.server_address else ""

logger.info(f'Connecting to Archipelago server at {address}')
try:
port = server_url.port or 38281
socket = await websockets.connect(address, port=port, ping_timeout=None, ping_interval=None,
ssl=get_ssl_context() if address.startswith("wss://") else None)
if ctx.ui is not None:
Expand Down

0 comments on commit 36d3913

Please sign in to comment.