From fe9c18f3efa346830ac138f800c77b87bf8b378a Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 21 Aug 2013 02:41:49 +0200 Subject: [PATCH] PEP 446: add get/set_inheritable() methods to socket.socket --- pep-0446.txt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pep-0446.txt b/pep-0446.txt index 774c3c0da..0d64fd5d4 100644 --- a/pep-0446.txt +++ b/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