Skip to content

Commit 28a7a4b

Browse files
itamarofacebook-github-bot
authored andcommitted
Build _asyncio as a static extension
Summary: backport of [gh-136669: build _asyncio as static module](python/cpython#136670) (upstream issue: [gh-136669](python/cpython#136669), as done in upstream for 3.15 Reviewed By: fried Differential Revision: D83414959 fbshipit-source-id: df542f1fdeeaaae9e836b723f8048b3499857d2a
1 parent ae0864c commit 28a7a4b

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

Modules/Setup.stdlib.in

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
############################################################################
3333
# Modules that should always be present (POSIX and Windows):
3434
@MODULE_ARRAY_TRUE@array arraymodule.c
35-
@MODULE__ASYNCIO_TRUE@_asyncio _asynciomodule.c
3635
@MODULE__BISECT_TRUE@_bisect _bisectmodule.c
3736
@MODULE__CSV_TRUE@_csv _csv.c
3837
@MODULE__HEAPQ_TRUE@_heapq _heapqmodule.c
@@ -190,3 +189,8 @@
190189
# Limited API template modules; must be built as shared modules.
191190
@MODULE_XXLIMITED_TRUE@xxlimited xxlimited.c
192191
@MODULE_XXLIMITED_35_TRUE@xxlimited_35 xxlimited_35.c
192+
193+
# for performance
194+
*static*
195+
196+
@MODULE__ASYNCIO_TRUE@_asyncio _asynciomodule.c

Modules/_remote_debugging_module.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ _Py_RemoteDebug_GetAsyncioDebugAddress(proc_handle_t* handle)
811811
}
812812
#elif defined(__linux__)
813813
// On Linux, search for asyncio debug in executable or DLL
814-
address = search_linux_map_for_section(handle, "AsyncioDebug", "_asyncio.cpython");
814+
address = search_linux_map_for_section(handle, "AsyncioDebug", "python");
815815
if (address == 0) {
816816
// Error out: 'python' substring covers both executable and DLL
817817
PyObject *exc = PyErr_GetRaisedException();
@@ -820,10 +820,10 @@ _Py_RemoteDebug_GetAsyncioDebugAddress(proc_handle_t* handle)
820820
}
821821
#elif defined(__APPLE__) && TARGET_OS_OSX
822822
// On macOS, try libpython first, then fall back to python
823-
address = search_map_for_section(handle, "AsyncioDebug", "_asyncio.cpython");
823+
address = search_map_for_section(handle, "AsyncioDebug", "libpython");
824824
if (address == 0) {
825825
PyErr_Clear();
826-
address = search_map_for_section(handle, "AsyncioDebug", "_asyncio.cpython");
826+
address = search_map_for_section(handle, "AsyncioDebug", "python");
827827
}
828828
if (address == 0) {
829829
// Error out: 'python' substring covers both executable and DLL

0 commit comments

Comments
 (0)