Skip to content

Commit a40bca2

Browse files
committed
Fix platform detection
1 parent 8c86f8f commit a40bca2

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/etc/check-sanitycheck.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@
1717

1818
STATUS = 0
1919

20-
2120
def error_unless_permitted(env_var, message):
2221
global STATUS
2322
if not os.getenv(env_var):
2423
sys.stderr.write(message)
2524
STATUS = 1
2625

27-
2826
def only_on(platforms):
2927
def decorator(func):
3028
@functools.wraps(func)
@@ -34,8 +32,7 @@ def inner():
3432
return inner
3533
return decorator
3634

37-
38-
@only_on(('linux', 'darwin', 'freebsd', 'openbsd'))
35+
@only_on(['linux', 'darwin', 'freebsd', 'openbsd'])
3936
def check_rlimit_core():
4037
import resource
4138
soft, hard = resource.getrlimit(resource.RLIMIT_CORE)
@@ -46,9 +43,9 @@ def check_rlimit_core():
4643
set ALLOW_NONZERO_RLIMIT_CORE to ignore this warning
4744
""" % (soft))
4845

49-
@only_on(('windows'))
46+
@only_on(['win32'])
5047
def check_console_code_page():
51-
if "65001" not in subprocess.check_output(['cmd', '/c', 'chcp']):
48+
if '65001' not in subprocess.check_output(['cmd', '/c', 'chcp']):
5249
sys.stderr.write('Warning: the console output code page is not UTF-8, \
5350
some tests may fail. Use `cmd /c "chcp 65001"` to setup UTF-8 code page.\n')
5451

0 commit comments

Comments
 (0)