mirror of
https://github.com/ArchipelagoMW/Archipelago.git
synced 2026-03-23 16:43:23 -07:00
Apply suggestions from code review
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
This commit is contained in:
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user