Keep `HAS_UDS` false on Windows
Modern Windows Python can expose `AF_UNIX`, so `trio.has_unix` alone can register the UDS backend even though its credential and lifecycle paths remain POSIX-only. Gate `HAS_UDS` on `sys.platform` and make the Windows import smoke step assert the TCP-only capability contract. (this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))wkt/macos_ci_reruns
parent
ca4582b003
commit
40be587ce2
|
|
@ -160,7 +160,7 @@ jobs:
|
|||
# tractor` must succeed everywhere, and `HAS_UDS` reflects
|
||||
# platform capability (False on Windows, True on POSIX).
|
||||
- name: 'Smoke: import tractor'
|
||||
run: uv run python -c "import tractor; from tractor.ipc._uds import HAS_UDS; print('import tractor OK | HAS_UDS=', HAS_UDS)"
|
||||
run: uv run python -c "import sys; import tractor; from tractor.ipc._uds import HAS_UDS; assert sys.platform != 'win32' or not HAS_UDS; print('import tractor OK | HAS_UDS=', HAS_UDS)"
|
||||
|
||||
- name: Run tests
|
||||
run: >
|
||||
|
|
|
|||
|
|
@ -115,10 +115,12 @@ _SUN_PATH_LIMIT: int = (
|
|||
|
||||
|
||||
# single source of truth for "is the UDS backend usable on this
|
||||
# host?" — reuse `trio`'s `has_unix` (the same predicate that gates
|
||||
# `trio.open_unix_socket()`) rather than re-deriving an `AF_UNIX`
|
||||
# probe in every consumer module.
|
||||
HAS_UDS: bool = has_unix
|
||||
# host?" Windows can expose `AF_UNIX`, but this backend remains
|
||||
# POSIX-only until its credential and lifecycle paths are supported.
|
||||
HAS_UDS: bool = (
|
||||
sys.platform != 'win32'
|
||||
and has_unix
|
||||
)
|
||||
|
||||
|
||||
def unwrap_sockpath(
|
||||
|
|
|
|||
Loading…
Reference in New Issue