From 63bc51d73d873087278780738ad6bd78a48a440c Mon Sep 17 00:00:00 2001 From: sobolevn Date: Tue, 24 Oct 2023 12:21:04 +0300 Subject: [PATCH] gh-111253: Fix socketmodule.c not checking for errors when initializing --- .../Library/2023-10-24-12-20-46.gh-issue-111253.HFywSK.rst | 1 + Modules/socketmodule.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2023-10-24-12-20-46.gh-issue-111253.HFywSK.rst 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 index 00000000000000..2671b899dfa4d5 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2023-10-24-12-20-46.gh-issue-111253.HFywSK.rst @@ -0,0 +1 @@ +Fix ``_socket`` module not checking for errors when initializing. diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 3d099d41d1e761..ddc18d845616fa 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -7723,10 +7723,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