From 805b978403a70898caca26cc2f7b0332970ee9c9 Mon Sep 17 00:00:00 2001 From: Uriel Date: Mon, 9 Mar 2026 13:55:34 -0300 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Doug Hoskisson --- WebHostLib/customserver.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/WebHostLib/customserver.py b/WebHostLib/customserver.py index a378959e74..037b768a34 100644 --- a/WebHostLib/customserver.py +++ b/WebHostLib/customserver.py @@ -193,7 +193,7 @@ class GameRangePorts(typing.NamedTuple): @functools.cache def parse_game_ports(game_ports: tuple[str | int, ...]) -> GameRangePorts: parsed_ports: list[range] = [] - weights = [] + weights: list[int] = [] ephemeral_allowed = False total_length = 0 @@ -247,13 +247,13 @@ def try_conns_per_process(p: psutil.Process) -> typing.Iterable[int]: try: return map(lambda c: c.laddr.port, p.net_connections("tcp4")) except psutil.AccessDenied: - return [] + return () def get_active_net_connections() -> typing.Iterable[int]: # Don't even try to check if system using AIX - if psutil._common.AIX: - return [] + if psutil.AIX: + return () try: return map(lambda c: c.laddr.port, psutil.net_connections("tcp4"))