diff options
author | Tian Gao <gaogaotiantian@hotmail.com> | 2024-05-03 18:45:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-03 18:45:46 (GMT) |
commit | 998c3856c1e922ece806c162858dc587a1e92e02 (patch) | |
tree | 03077e946db80e7e78df5a9c3e14e6ba5ca04bcf /Lib/multiprocessing/process.py | |
parent | cb57a52a85a7845b1c017085f05a7f6d71855edc (diff) | |
download | cpython-998c3856c1e922ece806c162858dc587a1e92e02.zip cpython-998c3856c1e922ece806c162858dc587a1e92e02.tar.gz cpython-998c3856c1e922ece806c162858dc587a1e92e02.tar.bz2 |
gh-83856: Honor atexit for all multiprocessing start methods (GH-114279)
Use atexit for all multiprocessing start methods to cleanup.
See the GH-114279 PR discussion and related issue for details as to why.
Diffstat (limited to 'Lib/multiprocessing/process.py')
-rw-r--r-- | Lib/multiprocessing/process.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Lib/multiprocessing/process.py b/Lib/multiprocessing/process.py index 271ba3f..b45f7df 100644 --- a/Lib/multiprocessing/process.py +++ b/Lib/multiprocessing/process.py @@ -310,11 +310,8 @@ class BaseProcess(object): # _run_after_forkers() is executed del old_process util.info('child process calling self.run()') - try: - self.run() - exitcode = 0 - finally: - util._exit_function() + self.run() + exitcode = 0 except SystemExit as e: if e.code is None: exitcode = 0 |