]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-111253: Fix error checking in _socket module init (GH-111254) (#111299)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 1 Nov 2023 20:01:28 +0000 (21:01 +0100)
committerGitHub <noreply@github.com>
Wed, 1 Nov 2023 20:01:28 +0000 (21:01 +0100)
gh-111253: Fix error checking in _socket module init (GH-111254)
(cherry picked from commit 3052c098ca2779c2d9ab9800dabe66d0efa01794)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Misc/NEWS.d/next/Library/2023-10-24-12-20-46.gh-issue-111253.HFywSK.rst [new file with mode: 0644]
Modules/socketmodule.c

diff --git a/Misc/NEWS.d/next/Library/2023-10-24-12-20-46.gh-issue-111253.HFywSK.rst b/Misc/NEWS.d/next/Library/2023-10-24-12-20-46.gh-issue-111253.HFywSK.rst
new file mode 100644 (file)
index 0000000..e21a426
--- /dev/null
@@ -0,0 +1 @@
+Add error checking during :mod:`!_socket` module init.
index 62b0e67be15c49c29b9dc7b0eb0f8e8c04e33375..de7229d2ced2f5a9ec0ddba8282701debc259d29 100644 (file)
@@ -7703,10 +7703,10 @@ socket_exec(PyObject *m)
 
 /* FreeBSD divert(4) */
 #ifdef PF_DIVERT
-    PyModule_AddIntMacro(m, PF_DIVERT);
+    ADD_INT_MACRO(m, PF_DIVERT);
 #endif
 #ifdef AF_DIVERT
-    PyModule_AddIntMacro(m, AF_DIVERT);
+    ADD_INT_MACRO(m, AF_DIVERT);
 #endif
 
 #ifdef AF_PACKET