Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 439956a

Browse files
authored
Fix ssl module, Python 2.7 doesn't have Py_MAX (python#5878)
Signed-off-by: Christian Heimes <[email protected]>
1 parent 4bb9b9a commit 439956a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Modules/_ssl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,8 @@ newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,
610610
}
611611
#elif defined(HAVE_INET_PTON)
612612
#ifdef ENABLE_IPV6
613-
char packed[Py_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];
613+
#define PySSL_MAX(x, y) (((x) > (y)) ? (x) : (y))
614+
char packed[PySSL_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];
614615
#else
615616
char packed[sizeof(struct in_addr)];
616617
#endif /* ENABLE_IPV6 */

0 commit comments

Comments
 (0)