mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.11] gh-79429: Ignore FileNotFoundError when remove a temporary directory in the multiprocessing finalizer (GH-112865) (GH-112897)
(cherry picked from commit 7e82c626c4
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
23234e9223
commit
2d8012f852
2 changed files with 6 additions and 1 deletions
|
@ -130,7 +130,10 @@ abstract_sockets_supported = _platform_supports_abstract_sockets()
|
|||
#
|
||||
|
||||
def _remove_temp_dir(rmtree, tempdir):
|
||||
rmtree(tempdir)
|
||||
def onerror(func, path, err_info):
|
||||
if not issubclass(err_info[0], FileNotFoundError):
|
||||
raise
|
||||
rmtree(tempdir, onerror=onerror)
|
||||
|
||||
current_process = process.current_process()
|
||||
# current_process() can be None if the finalizer is called
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue