From 95e0df8389c8a44c0f6c6b6be8363e602e8e8914 Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Mon, 8 Aug 2016 14:07:05 +0300 Subject: Issue #27702: Only expose SOCK_RAW when defined SOCK_RAW is marked as optional in the POSIX specification: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html Patch by Ed Schouten. --- Modules/socketmodule.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index d21d18f..d21509e 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -6495,7 +6495,10 @@ PyInit__socket(void) PyModule_AddIntMacro(m, SOCK_STREAM); PyModule_AddIntMacro(m, SOCK_DGRAM); /* We have incomplete socket support. */ +#ifdef SOCK_RAW + /* SOCK_RAW is marked as optional in the POSIX specification */ PyModule_AddIntMacro(m, SOCK_RAW); +#endif PyModule_AddIntMacro(m, SOCK_SEQPACKET); #if defined(SOCK_RDM) PyModule_AddIntMacro(m, SOCK_RDM); -- cgit v0.12