mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Fix bpo-30596: Add close() method to multiprocessing.Process (#2010)
* Fix bpo-30596: Add close() method to multiprocessing.Process * Raise ValueError if close() is called before the Process is finished running * Add docs * Add NEWS blurb
This commit is contained in:
parent
0ee32c1481
commit
13e96cc596
9 changed files with 106 additions and 8 deletions
|
@ -62,7 +62,7 @@ class Popen(popen_fork.Popen):
|
|||
f.write(fp.getbuffer())
|
||||
finally:
|
||||
if parent_r is not None:
|
||||
util.Finalize(self, os.close, (parent_r,))
|
||||
self.finalizer = util.Finalize(self, os.close, (parent_r,))
|
||||
for fd in (child_r, child_w, parent_w):
|
||||
if fd is not None:
|
||||
os.close(fd)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue