From daf455554bc21b6b5df0a016ab5fa639d36cc595 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 28 Aug 2013 00:53:59 +0200 Subject: Issue #18571: Implementation of the PEP 446: file descriptors and file handles are now created non-inheritable; add functions os.get/set_inheritable(), os.get/set_handle_inheritable() and socket.socket.get/set_inheritable(). --- Lib/multiprocessing/util.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Lib/multiprocessing/util.py') diff --git a/Lib/multiprocessing/util.py b/Lib/multiprocessing/util.py index d9e4799d0a..ac8e9136c1 100644 --- a/Lib/multiprocessing/util.py +++ b/Lib/multiprocessing/util.py @@ -365,7 +365,7 @@ def spawnv_passfds(path, args, passfds): if flag & fcntl.FD_CLOEXEC: fcntl.fcntl(fd, fcntl.F_SETFD, flag & ~fcntl.FD_CLOEXEC) tmp.append((fd, flag)) - errpipe_read, errpipe_write = _posixsubprocess.cloexec_pipe() + errpipe_read, errpipe_write = os.pipe() try: return _posixsubprocess.fork_exec( args, [os.fsencode(path)], True, passfds, None, None, @@ -381,7 +381,9 @@ def spawnv_passfds(path, args, passfds): # # Return pipe with CLOEXEC set on fds # +# Deprecated: os.pipe() creates non-inheritable file descriptors +# since Python 3.4 +# def pipe(): - import _posixsubprocess - return _posixsubprocess.cloexec_pipe() + return os.pipe() -- cgit v1.2.1