PEP 446: add get/set_inheritable() methods to socket.socket
This commit is contained in:
parent
967fad663d
commit
fe9c18f3ef
13
pep-0446.txt
13
pep-0446.txt
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue