functional2: handle unset or empty BUILD_TEST_SHELL properly

If BUILD_TEST_SHELL is not set or empty, None or the empty string respectively
should not make it into the PATH. Ensure this property.

Change-Id: I4ce9b0c06c407b465308b63b9cb64e7d6a6a6964
This commit is contained in:
Alois Wohlschlager
2025-10-22 07:41:46 +02:00
parent 5346b2bc68
commit 0e0853cc70
+4 -3
View File
@@ -20,12 +20,13 @@ class _ManagedPath:
Wrapper class to handle building the `PATH` environment variable
"""
build_shell: dataclasses.InitVar[str]
build_shell: dataclasses.InitVar[str | None]
"""statically linked shell to use within builds which provides coreutils functionality"""
_path: list[str] = dataclasses.field(default_factory=list)
def __post_init__(self, build_shell: str):
self.prepend(build_shell)
def __post_init__(self, build_shell: str | None):
if build_shell:
self.prepend(build_shell)
def to_path(self) -> str:
"""