summaryrefslogtreecommitdiffstats
path: root/Lib/multiprocessing/popen_forkserver.py
diff options
context:
space:
mode:
authorAntoine Pitrou <pitrou@free.fr>2017-06-24 17:22:23 (GMT)
committerGitHub <noreply@github.com>2017-06-24 17:22:23 (GMT)
commit13e96cc596d158b98996db3fa291086ea4afecd9 (patch)
treee5d5abb7f5364b484ca4396ff99986ccac16ed0c /Lib/multiprocessing/popen_forkserver.py
parent0ee32c148119031e19c79359f5c4789ee69fa355 (diff)
downloadcpython-13e96cc596d158b98996db3fa291086ea4afecd9.zip
cpython-13e96cc596d158b98996db3fa291086ea4afecd9.tar.gz
cpython-13e96cc596d158b98996db3fa291086ea4afecd9.tar.bz2
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
Diffstat (limited to 'Lib/multiprocessing/popen_forkserver.py')
-rw-r--r--Lib/multiprocessing/popen_forkserver.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/multiprocessing/popen_forkserver.py b/Lib/multiprocessing/popen_forkserver.py
index fa8e574..a51a277 100644
--- a/Lib/multiprocessing/popen_forkserver.py
+++ b/Lib/multiprocessing/popen_forkserver.py
@@ -49,7 +49,7 @@ class Popen(popen_fork.Popen):
set_spawning_popen(None)
self.sentinel, w = forkserver.connect_to_new_process(self._fds)
- util.Finalize(self, os.close, (self.sentinel,))
+ self.finalizer = util.Finalize(self, os.close, (self.sentinel,))
with open(w, 'wb', closefd=True) as f:
f.write(buf.getbuffer())
self.pid = forkserver.read_signed(self.sentinel)