]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-111995: Add getnameinfo extension flag (#111994)
authoradder32 <x@arcticadder.net>
Wed, 15 Nov 2023 01:00:24 +0000 (02:00 +0100)
committerGitHub <noreply@github.com>
Wed, 15 Nov 2023 01:00:24 +0000 (01:00 +0000)
Add getnameinfo extension NI_IDN flag.

Misc/NEWS.d/next/Library/2023-11-14-16-31-59.gh-issue-111995.OoX8JJ.rst [new file with mode: 0644]
Modules/socketmodule.c

diff --git a/Misc/NEWS.d/next/Library/2023-11-14-16-31-59.gh-issue-111995.OoX8JJ.rst b/Misc/NEWS.d/next/Library/2023-11-14-16-31-59.gh-issue-111995.OoX8JJ.rst
new file mode 100644 (file)
index 0000000..773f620
--- /dev/null
@@ -0,0 +1,2 @@
+Added the ``NI_IDN`` constant to the :mod:`socket` module when present in C
+at build time for use with :func:`socket.getnameinfo`.
index 2e1a0974ceb75de094f42b0977c317a0a0166347..9ac2001c0132d35fbbe3e13fb56fbe373f94a9ce 100644 (file)
@@ -8803,6 +8803,9 @@ socket_exec(PyObject *m)
 #ifdef NI_DGRAM
     ADD_INT_MACRO(m, NI_DGRAM);
 #endif
+#ifdef NI_IDN
+    ADD_INT_MACRO(m, NI_IDN);
+#endif
 
     /* shutdown() parameters */
 #ifdef SHUT_RD