Skip to content

Commit 52d9d82

Browse files
committed
[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 "<stdin>", line 1, in <module> AttributeError: module 'os' has no attribute 'sysconf'
1 parent 01a98b3 commit 52d9d82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ 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(b'import os; print(os.sysconf("SC_PAGESIZE") if hasattr(os, "sysconf") else "")')
975975
return int(out)
976976
except:
977977
return 4096

0 commit comments

Comments
 (0)