mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.12] gh-79429: Ignore FileNotFoundError when remove a temporary directory in the multiprocessing finalizer (GH-112865)
This commit is contained in:
parent
259a4af3d2
commit
7e82c626c4
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
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
Ignore FileNotFoundError when remove a temporary directory in the
|
||||
multiprocessing finalizer.
|
Loading…
Add table
Add a link
Reference in a new issue