Skip to content

Commit 6b1f15c

Browse files
mstorsjofmayer
authored andcommitted
[compiler-rt] [test] Avoid error printouts if os.sysconf is missing (llvm#168857)
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 "<stdin>", line 1, in <module> AttributeError: module 'os' has no attribute 'sysconf' Co-authored-by: Florian Mayer <[email protected]>
1 parent 88b5af0 commit 6b1f15c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler-rt/test/lit.common.cfg.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,9 @@ def target_page_size():
971971
stdin=subprocess.PIPE,
972972
stdout=subprocess.PIPE,
973973
)
974-
out, err = proc.communicate(b'import os; print(os.sysconf("SC_PAGESIZE"))')
974+
out, err = proc.communicate(
975+
b'import os; print(os.sysconf("SC_PAGESIZE") if hasattr(os, "sysconf") else "")'
976+
)
975977
return int(out)
976978
except:
977979
return 4096

0 commit comments

Comments
 (0)