[Python-checkins] cpython: - Comment out socket (SO_REUSEPORT) and posix (O_SHLOCK, O_EXLOCK) constants

matthias.klose python-checkins at python.org
Mon Jun 13 10:34:08 EDT 2016


https://hg.python.org/cpython/rev/c78774c7d032
changeset:   101975:c78774c7d032
user:        doko at ubuntu.com
date:        Mon Jun 13 16:33:04 2016 +0200
summary:
  - Comment out socket (SO_REUSEPORT) and posix (O_SHLOCK, O_EXLOCK) constants
  exposed on the API which are not implemented on GNU/Hurd. They would not
  work at runtime anyway.

files:
  Misc/NEWS              |  4 ++++
  Modules/posixmodule.c  |  2 ++
  Modules/socketmodule.c |  2 ++
  3 files changed, 8 insertions(+), 0 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -50,6 +50,10 @@
 Library
 -------
 
+- Comment out socket (SO_REUSEPORT) and posix (O_SHLOCK, O_EXLOCK) constants
+  exposed on the API which are not implemented on GNU/Hurd. They would not
+  work at runtime anyway.
+
 - Issue #25455: Fixed crashes in repr of recursive ElementTree.Element and
   functools.partial objects.
 
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -12658,12 +12658,14 @@
 #ifdef O_LARGEFILE
     if (PyModule_AddIntMacro(m, O_LARGEFILE)) return -1;
 #endif
+#ifndef __GNU__
 #ifdef O_SHLOCK
     if (PyModule_AddIntMacro(m, O_SHLOCK)) return -1;
 #endif
 #ifdef O_EXLOCK
     if (PyModule_AddIntMacro(m, O_EXLOCK)) return -1;
 #endif
+#endif
 #ifdef O_EXEC
     if (PyModule_AddIntMacro(m, O_EXEC)) return -1;
 #endif
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -6529,9 +6529,11 @@
 #ifdef  SO_OOBINLINE
     PyModule_AddIntMacro(m, SO_OOBINLINE);
 #endif
+#ifndef __GNU__
 #ifdef  SO_REUSEPORT
     PyModule_AddIntMacro(m, SO_REUSEPORT);
 #endif
+#endif
 #ifdef  SO_SNDBUF
     PyModule_AddIntMacro(m, SO_SNDBUF);
 #endif

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


More information about the Python-checkins mailing list