From 702226e1fd6335327245cf4a9ac94b68f3fc4b37 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Tue, 4 Jul 2023 13:32:38 +0300 Subject: [PATCH] Add missing `TCP_CONNECTION_INFO` to `socket` module (#10402) --- stdlib/socket.pyi | 2 ++ tests/stubtest_allowlists/darwin-py311.txt | 3 --- tests/stubtest_allowlists/darwin-py312.txt | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/stdlib/socket.pyi b/stdlib/socket.pyi index e1ffc573b..5dd92ec8e 100644 --- a/stdlib/socket.pyi +++ b/stdlib/socket.pyi @@ -468,6 +468,8 @@ if sys.version_info >= (3, 12): ETHERTYPE_IPV6 as ETHERTYPE_IPV6, ETHERTYPE_VLAN as ETHERTYPE_VLAN, ) +if sys.version_info >= (3, 11) and sys.platform == "darwin": + from _socket import TCP_CONNECTION_INFO as TCP_CONNECTION_INFO # Re-exported from errno EBADF: int diff --git a/tests/stubtest_allowlists/darwin-py311.txt b/tests/stubtest_allowlists/darwin-py311.txt index da55c1878..c851f2085 100644 --- a/tests/stubtest_allowlists/darwin-py311.txt +++ b/tests/stubtest_allowlists/darwin-py311.txt @@ -1,9 +1,6 @@ _?curses.color_pair xxlimited.Xxo.x_exports -# Exists at runtime, missing from stub -socket.TCP_CONNECTION_INFO - (dbm.gnu)? (locale.bind_textdomain_codeset)? (locale.bindtextdomain)? diff --git a/tests/stubtest_allowlists/darwin-py312.txt b/tests/stubtest_allowlists/darwin-py312.txt index 216f19e7f..b9e9f0e2c 100644 --- a/tests/stubtest_allowlists/darwin-py312.txt +++ b/tests/stubtest_allowlists/darwin-py312.txt @@ -13,7 +13,6 @@ posix.PRIO_DARWIN_BG posix.PRIO_DARWIN_NONUI posix.PRIO_DARWIN_PROCESS posix.PRIO_DARWIN_THREAD -socket.TCP_CONNECTION_INFO syslog.LOG_MASK syslog.LOG_UPTO syslog.setlogmask