Mercurial > cpython-lru_cache-weakref
diff Lib/test/test_logging.py @ 72011:b5ccdf7c032a
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')
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Sun, 21 Aug 2011 00:39:18 +0200 |
| parents | 50f1922bc1d5 |
| children | 5611acf6917c |
line wrap: on
line diff
--- a/Lib/test/test_logging.py Sun Aug 21 00:16:49 2011 +0200 +++ b/Lib/test/test_logging.py Sun Aug 21 00:39:18 2011 +0200 @@ -527,7 +527,7 @@ def test_builtin_handlers(self): # We can't actually *use* too many handlers in the tests, # but we can try instantiating them with various options - if sys.platform.startswith('linux') or sys.platform == 'darwin': + if sys.platform in ('linux', 'darwin'): for existing in (True, False): fd, fn = tempfile.mkstemp() os.close(fd)
