Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit69d8fe5

Browse files
authored
gh-126548: Add a thread-unsafety warning forimportlib.reload() (GH-136704)
1 parentdcd27aa commit69d8fe5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎Doc/library/importlib.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ Functions
206206
:exc:`ModuleNotFoundError` is raised when the module being reloaded lacks
207207
a:class:`~importlib.machinery.ModuleSpec`.
208208

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

210214
:mod:`importlib.abc` -- Abstract base classes related to import
211215
---------------------------------------------------------------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp