PEP 446: add get/set_inheritable() methods to socket.socket

This commit is contained in:
Victor Stinner 2013-08-21 02:41:49 +02:00
parent 967fad663d
commit fe9c18f3ef
1 changed files with 8 additions and 5 deletions

View File

@ -490,8 +490,8 @@ non-inheritable. The atomicity is not guaranteed because a fallback is
required when atomic flags are not available.
New Functions
-------------
New Functions And Methods
-------------------------
New functions available on all platforms:
@ -507,9 +507,12 @@ New functions only available on Windows:
* ``os.set_handle_inheritable(handle: int, inheritable: bool)``: clear
or set the inheritable flag of the specified handle.
The ``fileno()`` method of a socket returns a file descriptor on UNIX,
whereas it returns a handle on Windows. So a different function must be
used depending on the platform to manage the inheritable of a socket.
New methods:
* ``socket.socket.get_inheritable()``: return ``True`` if the
socket can be inherited by child processes, ``False`` otherwise.
* ``socket.socket.set_inheritable(inheritable: bool)``: clear
or set the inheritable flag of the specified socket.
Other Changes