Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Doc/library/importlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ Functions
:exc:`ModuleNotFoundError` is raised when the module being reloaded lacks
a :class:`~importlib.machinery.ModuleSpec`.

.. warning::
This function is not thread-safe. Calling it from multiple threads can result
in unexpected behavior. It's recommended to use the :class:`threading.Lock`
or other synchronization primitives for thread-safe module reloading.

:mod:`importlib.abc` -- Abstract base classes related to import
---------------------------------------------------------------
Expand Down
8 changes: 1 addition & 7 deletions Lib/test/test_warnings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,13 +555,7 @@ def test_warn_explicit_non_ascii_filename(self):
with self.module.catch_warnings(record=True) as w:
self.module.resetwarnings()
self.module.filterwarnings("always", category=UserWarning)
filenames = ["nonascii\xe9\u20ac"]
if not support.is_emscripten:
# JavaScript does not like surrogates.
# Invalid UTF-8 leading byte 0x80 encountered when
# deserializing a UTF-8 string in wasm memory to a JS
# string!
filenames.append("surrogate\udc80")
filenames = ["nonascii\xe9\u20ac", "surrogate\udc80"]
for filename in filenames:
try:
os.fsencode(filename)
Expand Down
6 changes: 6 additions & 0 deletions Lib/traceback.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,12 @@ class FrameSummary:
of code that was running when the frame was captured.
- :attr:`locals` Either None if locals were not supplied, or a dict
mapping the name to the repr() of the variable.
- :attr:`end_lineno` The last line number of the source code for this frame.
By default, it is set to lineno and indexation starts from 1.
- :attr:`colno` The column number of the source code for this frame.
By default, it is None and indexation starts from 0.
- :attr:`end_colno` The last column number of the source code for this frame.
By default, it is None and indexation starts from 0.
"""

__slots__ = ('filename', 'lineno', 'end_lineno', 'colno', 'end_colno',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:mod:`!_asyncio` is now statically linked for improved performance.
7 changes: 6 additions & 1 deletion Modules/Setup.stdlib.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
############################################################################
# Modules that should always be present (POSIX and Windows):
@MODULE_ARRAY_TRUE@array arraymodule.c
@MODULE__ASYNCIO_TRUE@_asyncio _asynciomodule.c
@MODULE__BISECT_TRUE@_bisect _bisectmodule.c
@MODULE__CSV_TRUE@_csv _csv.c
@MODULE__HEAPQ_TRUE@_heapq _heapqmodule.c
Expand Down Expand Up @@ -193,3 +192,9 @@
# Limited API template modules; must be built as shared modules.
@MODULE_XXLIMITED_TRUE@xxlimited xxlimited.c
@MODULE_XXLIMITED_35_TRUE@xxlimited_35 xxlimited_35.c


# for performance
*static*

@MODULE__ASYNCIO_TRUE@_asyncio _asynciomodule.c
6 changes: 3 additions & 3 deletions Modules/_remote_debugging_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ _Py_RemoteDebug_GetAsyncioDebugAddress(proc_handle_t* handle)
}
#elif defined(__linux__)
// On Linux, search for asyncio debug in executable or DLL
address = search_linux_map_for_section(handle, "AsyncioDebug", "_asyncio.cpython");
address = search_linux_map_for_section(handle, "AsyncioDebug", "python");
if (address == 0) {
// Error out: 'python' substring covers both executable and DLL
PyObject *exc = PyErr_GetRaisedException();
Expand All @@ -820,10 +820,10 @@ _Py_RemoteDebug_GetAsyncioDebugAddress(proc_handle_t* handle)
}
#elif defined(__APPLE__) && TARGET_OS_OSX
// On macOS, try libpython first, then fall back to python
address = search_map_for_section(handle, "AsyncioDebug", "_asyncio.cpython");
address = search_map_for_section(handle, "AsyncioDebug", "libpython");
if (address == 0) {
PyErr_Clear();
address = search_map_for_section(handle, "AsyncioDebug", "_asyncio.cpython");
address = search_map_for_section(handle, "AsyncioDebug", "python");
}
if (address == 0) {
// Error out: 'python' substring covers both executable and DLL
Expand Down
Loading