fixed test_signal_processing error

This commit is contained in:
ykcheungab
2026-09-20 11:27:06 +08:00
parent e2b906a640
commit 2e7b65298b
2 changed files with 46 additions and 16 deletions
+15 -10
View File
@@ -104,16 +104,21 @@ def _runtime_roots() -> list[Path]:
continue
anchors = _unique_paths(anchors)
# Keep the *innermost* matching directories. Walking up from the launcher
# also visits every parent, and a parent that happens to carry an
# ``examples/`` directory must not outrank the real root below it: doing so
# made a workspace directory shadow the release root's own bundle.
return [
path
for path in anchors
if _is_sdk_runtime_root(path)
and not any(other != path and other.is_relative_to(path) for other in anchors)
]
# The run root is the *nearest* runnable directory, walking up from the
# launcher: starting at the cwd, then the script's directory, then the
# entries sys.path. Order carries the meaning here -- containment does not.
# Scanning every anchor for the shortest match instead picked the shallowest
# ancestor, so a workspace that carried ``examples/`` alongside ``sensors/``
# absorbed the real root below it and its bundle shadowed that root's own.
roots: list[Path] = []
for path in anchors:
if not _is_sdk_runtime_root(path):
continue
if any(existing.is_relative_to(path) or path.is_relative_to(existing) for existing in roots):
# Same tree: only the nearest root counts.
continue
roots.append(path)
return roots
def _candidate_config_dirs() -> list[Path]: