summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2017-12-29 21:13:06 (GMT)
committerGitHub <noreply@github.com>2017-12-29 21:13:06 (GMT)
commitbbdb17d19bb1d5443ca4417254e014ad64c04540 (patch)
treefc518799f5fedc84812666d3994fa19aec5f2f8d /Doc/library
parent03220fdb26c0b6a50ce5ed1fdfbf232094b66db6 (diff)
downloadcpython-bbdb17d19bb1d5443ca4417254e014ad64c04540.zip
cpython-bbdb17d19bb1d5443ca4417254e014ad64c04540.tar.gz
cpython-bbdb17d19bb1d5443ca4417254e014ad64c04540.tar.bz2
return the new file descriptor from os.dup2 (closes bpo-32441) (#5041)
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/os.rst10
1 files changed, 7 insertions, 3 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index a24934c..ee08853 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -735,13 +735,17 @@ as internal buffering of data.
.. function:: dup2(fd, fd2, inheritable=True)
- Duplicate file descriptor *fd* to *fd2*, closing the latter first if necessary.
- The file descriptor *fd2* is :ref:`inheritable <fd_inheritance>` by default,
- or non-inheritable if *inheritable* is ``False``.
+ Duplicate file descriptor *fd* to *fd2*, closing the latter first if
+ necessary. Return *fd2*. The new file descriptor is :ref:`inheritable
+ <fd_inheritance>` by default or non-inheritable if *inheritable*
+ is ``False``.
.. versionchanged:: 3.4
Add the optional *inheritable* parameter.
+ .. versionchanged:: 3.7
+ Return *fd2* on success. Previously, ``None`` was always returned.
+
.. function:: fchmod(fd, mode)