From ce2f9312ca18106168870c8cf836dfd545b7488b Mon Sep 17 00:00:00 2001 From: Bryce Wilson Date: Tue, 28 Nov 2023 13:50:12 -0800 Subject: [PATCH] BizHawkClient: Change `open_connection` to use 127.0.0.1 instead of localhost (#2525) When using localhost on mac, both ipv4 and ipv6 are tried and raise separate errors which are combined by asyncio and difficult/inelegant to handle. Python 3.12 adds the argument all_errors, which would make this easier. --- worlds/_bizhawk/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worlds/_bizhawk/__init__.py b/worlds/_bizhawk/__init__.py index cddfde4ff37f..94a9ce1ddf04 100644 --- a/worlds/_bizhawk/__init__.py +++ b/worlds/_bizhawk/__init__.py @@ -97,7 +97,7 @@ async def connect(ctx: BizHawkContext) -> bool: for port in ports: try: - ctx.streams = await asyncio.open_connection("localhost", port) + ctx.streams = await asyncio.open_connection("127.0.0.1", port) ctx.connection_status = ConnectionStatus.TENTATIVE ctx._port = port return True