[Jython-checkins] jython: Define socket.SOL_TCP. Fixes #2436.

jim.baker jython-checkins at python.org
Mon Nov 23 16:32:55 EST 2015


https://hg.python.org/jython/rev/b8fec161bcbb
changeset:   7822:b8fec161bcbb
user:        Jim Baker <jim.baker at rackspace.com>
date:        Mon Nov 23 14:32:48 2015 -0700
summary:
  Define socket.SOL_TCP. Fixes #2436.

files:
  Lib/_socket.py                                        |    2 +-
  Lib/ensurepip/_bundled/pip-7.1.2-py2.py3-none-any.whl |  Bin 
  Lib/socket.py                                         |    1 +
  Lib/test/test_socket_jy.py                            |   10 +++++++++-
  4 files changed, 11 insertions(+), 2 deletions(-)


diff --git a/Lib/_socket.py b/Lib/_socket.py
--- a/Lib/_socket.py
+++ b/Lib/_socket.py
@@ -135,7 +135,7 @@
 IPPROTO_PUP      =  12 # not supported
 IPPROTO_RAW      = 255 # not supported
 IPPROTO_ROUTING  =  43 # not supported
-IPPROTO_TCP      =   6
+SOL_TCP = IPPROTO_TCP = 6
 IPPROTO_UDP      =  17
 
 SO_ACCEPTCONN  = 1
diff --git a/Lib/ensurepip/_bundled/pip-7.1.2-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/pip-7.1.2-py2.py3-none-any.whl
index 5e490155f0ca7f4ddb64c93c39fb2efb8795cd08..610a36c5f1b1a4357784474766d3e785b45d9ed9
GIT binary patch
[stripped]
diff --git a/Lib/socket.py b/Lib/socket.py
--- a/Lib/socket.py
+++ b/Lib/socket.py
@@ -55,6 +55,7 @@
     SOCK_SEQPACKET,
     
     SOL_SOCKET,
+    SOL_TCP,
     # not supported, but here for apparent completeness
     IPPROTO_AH,
     IPPROTO_DSTOPTS,
diff --git a/Lib/test/test_socket_jy.py b/Lib/test/test_socket_jy.py
--- a/Lib/test/test_socket_jy.py
+++ b/Lib/test/test_socket_jy.py
@@ -74,8 +74,16 @@
                 self.assertEqual(code, errno.EALREADY)
 
 
+class SocketOptionsTest(unittest.TestCase):
+
+    def test_socket_options_defined(self):
+        # Basic existence test to verify trivial fix for
+        # http://bugs.jython.org/issue2436
+        self.assertEqual(socket.SOL_TCP, socket.IPPROTO_TCP)
+
+
 def test_main():
-    test_support.run_unittest(SocketConnectTest)
+    test_support.run_unittest(SocketConnectTest, SocketOptionsTest)
 
 
 if __name__ == "__main__":

-- 
Repository URL: https://hg.python.org/jython


More information about the Jython-checkins mailing list