Issue #12326: refactor usage of sys.platform
* Use str.startswith(tuple): I didn't know this Python feature, Python rocks!
* Replace sometimes sys.platform.startswith('linux') with
sys.platform == 'linux'
* sys.platform doesn't contain the major version on Cygwin on Mac OS X
(it's just 'cygwin' and 'darwin')
diff --git a/Lib/test/support.py b/Lib/test/support.py
index 64c1b4e..b3989e5 100644
--- a/Lib/test/support.py
+++ b/Lib/test/support.py
@@ -311,7 +311,7 @@
def decorator(func):
@functools.wraps(func)
def wrapper(*args, **kw):
- if sys.platform.startswith('linux'):
+ if sys.platform == 'linux':
version_txt = platform.release().split('-', 1)[0]
try:
version = tuple(map(int, version_txt.split('.')))