diff --git a/src/etc/check-sanitycheck.py b/src/etc/check-sanitycheck.py index b3dc290e36b1f..0e103fbcffbad 100644 --- a/src/etc/check-sanitycheck.py +++ b/src/etc/check-sanitycheck.py @@ -17,14 +17,12 @@ STATUS = 0 - def error_unless_permitted(env_var, message): global STATUS if not os.getenv(env_var): sys.stderr.write(message) STATUS = 1 - def only_on(platforms): def decorator(func): @functools.wraps(func) @@ -34,8 +32,7 @@ def inner(): return inner return decorator - -@only_on(('linux', 'darwin', 'freebsd', 'openbsd')) +@only_on(['linux', 'darwin', 'freebsd', 'openbsd']) def check_rlimit_core(): import resource soft, hard = resource.getrlimit(resource.RLIMIT_CORE) @@ -46,9 +43,9 @@ def check_rlimit_core(): set ALLOW_NONZERO_RLIMIT_CORE to ignore this warning """ % (soft)) -@only_on(('windows')) +@only_on(['win32']) def check_console_code_page(): - if "65001" not in subprocess.check_output(['cmd', '/c', 'chcp']): + if '65001' not in subprocess.check_output(['cmd', '/c', 'chcp']): sys.stderr.write('Warning: the console output code page is not UTF-8, \ some tests may fail. Use `cmd /c "chcp 65001"` to setup UTF-8 code page.\n')