diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-23 22:24:19 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-23 22:24:19 (GMT) |
commit | fea0f4d51717fb4b89154e97cfc0084a4965a688 (patch) | |
tree | 5c5234bd9ef25cc2f74445aa9a98b4134e85baf7 /Lib/test/test_socket.py | |
parent | 25000d4d31dfa5842776aa92f234ea6672489c67 (diff) | |
download | cpython-fea0f4d51717fb4b89154e97cfc0084a4965a688.zip cpython-fea0f4d51717fb4b89154e97cfc0084a4965a688.tar.gz cpython-fea0f4d51717fb4b89154e97cfc0084a4965a688.tar.bz2 |
Issue #12158: Move linux_version() from test_socket to test.support
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r-- | Lib/test/test_socket.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index a449f5b..59e3019 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -24,14 +24,6 @@ try: except ImportError: fcntl = False -def linux_version(): - try: - # platform.release() is something like '2.6.33.7-desktop-2mnb' - version_string = platform.release().split('-')[0] - return tuple(map(int, version_string.split('.'))) - except ValueError: - return 0, 0, 0 - HOST = support.HOST MSG = 'Michael Gilfix was here\u1234\r\n'.encode('utf-8') ## test unicode string and carriage return @@ -1032,7 +1024,7 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest): if hasattr(socket, "SOCK_NONBLOCK"): def testInitNonBlocking(self): - v = linux_version() + v = support.linux_version() if v < (2, 6, 28): self.skipTest("Linux kernel 2.6.28 or higher required, not %s" % ".".join(map(str, v))) @@ -2010,7 +2002,7 @@ class ContextManagersTest(ThreadedTCPSocketTest): @unittest.skipUnless(fcntl, "module fcntl not available") class CloexecConstantTest(unittest.TestCase): def test_SOCK_CLOEXEC(self): - v = linux_version() + v = support.linux_version() if v < (2, 6, 28): self.skipTest("Linux kernel 2.6.28 or higher required, not %s" % ".".join(map(str, v))) @@ -2032,7 +2024,7 @@ class NonblockConstantTest(unittest.TestCase): self.assertEqual(s.gettimeout(), None) def test_SOCK_NONBLOCK(self): - v = linux_version() + v = support.linux_version() if v < (2, 6, 28): self.skipTest("Linux kernel 2.6.28 or higher required, not %s" % ".".join(map(str, v))) |