[libcxx-commits] [libcxx] [llvm] [LIT] remove `to_unicode`, `to_string`, and `to_bytes` helpers (PR #165950)

Tomohiro Kashiwada via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 4 04:58:38 PST 2025


================
@@ -1405,14 +1385,14 @@ def executeScript(test, litConfig, tmpBase, commands, cwd):
             for k, v in test.config.environment.items()
             if k.startswith("DYLD_")
         )
-        f.write(bytes(env_str, "utf-8") if mode == "wb" else env_str)
-        f.write(b"set -x;" if mode == "wb" else "set -x;")
-        if mode == "wb":
-            f.write(bytes("{ " + "; } &&\n{ ".join(commands) + "; }", "utf-8"))
-        else:
+
+        with open(script, "w", encoding="utf-8", newline="") as f:
----------------
kikairoya wrote:

I think using of `str` is straightforward here, as it's aligned with `env_str` and `commands`, that are written to `f`.

https://github.com/llvm/llvm-project/pull/165950


More information about the libcxx-commits mailing list