mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-12-02 14:28:54 -06:00
RETROBIOS_OFFLINE was read by six callers and never by the network gateway: a caller that did not pass offline=True sent the request, untokened. core.offline holds the rule, open_retrying refuses with OfflineError and the cached reads answer as an offline run. The callers read the same predicate, and the tests that fake the network clear the variable for themselves (tests.ONLINE).
15 lines
479 B
Python
15 lines
479 B
Python
"""Whether a run fetches nothing: the one rule core.upstream and its callers read."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
# Set, this run fetches nothing whatever its callers pass: the test runners
|
|
# and the PR checks set it.
|
|
OFFLINE_ENV = "RETROBIOS_OFFLINE"
|
|
|
|
|
|
def run_is_offline(offline: bool | None = False) -> bool:
|
|
"""Whether this run fetches nothing: the caller's flag, or RETROBIOS_OFFLINE."""
|
|
return bool(offline) or bool(os.environ.get(OFFLINE_ENV))
|