From 52d9d821bc17e679d08ead2e6dc23c9e859b30ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 20 Nov 2025 11:09:20 +0000 Subject: [PATCH 1/2] [compiler-rt] [test] Avoid error printouts if os.sysconf is missing This avoids dozens of instances of benign error messages being printed when running the tests on e.g. Windows: Traceback (most recent call last): File "", line 1, in AttributeError: module 'os' has no attribute 'sysconf' --- compiler-rt/test/lit.common.cfg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler-rt/test/lit.common.cfg.py b/compiler-rt/test/lit.common.cfg.py index ea22fb0babc46..62bee33b1fdb0 100644 --- a/compiler-rt/test/lit.common.cfg.py +++ b/compiler-rt/test/lit.common.cfg.py @@ -971,7 +971,7 @@ def target_page_size(): stdin=subprocess.PIPE, stdout=subprocess.PIPE, ) - out, err = proc.communicate(b'import os; print(os.sysconf("SC_PAGESIZE"))') + out, err = proc.communicate(b'import os; print(os.sysconf("SC_PAGESIZE") if hasattr(os, "sysconf") else "")') return int(out) except: return 4096 From d2735212b09fd67c640e685d4df804dad5c94c1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Mon, 24 Nov 2025 23:20:11 +0200 Subject: [PATCH 2/2] Reformat --- compiler-rt/test/lit.common.cfg.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler-rt/test/lit.common.cfg.py b/compiler-rt/test/lit.common.cfg.py index 62bee33b1fdb0..dce01cc9743b3 100644 --- a/compiler-rt/test/lit.common.cfg.py +++ b/compiler-rt/test/lit.common.cfg.py @@ -971,7 +971,9 @@ def target_page_size(): stdin=subprocess.PIPE, stdout=subprocess.PIPE, ) - out, err = proc.communicate(b'import os; print(os.sysconf("SC_PAGESIZE") if hasattr(os, "sysconf") else "")') + out, err = proc.communicate( + b'import os; print(os.sysconf("SC_PAGESIZE") if hasattr(os, "sysconf") else "")' + ) return int(out) except: return 4096