Mercurial > hg-stable
changeset 49304:b6b6ae9ea91e
py3: remove dead code to make file descriptors non-inheritable
On Python 3, file descriptors are already non-inheritable by default.
author | Manuel Jacob <me@manueljacob.de> |
---|---|
date | Sun, 29 May 2022 15:43:21 +0200 |
parents | 7d9a45c7517f |
children | 402f9f0f9387 |
files | tests/test-stdio.py |
diffstat | 1 files changed, 0 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-stdio.py Sun May 29 15:53:01 2022 +0200 +++ b/tests/test-stdio.py Sun May 29 15:43:21 2022 +0200 @@ -16,25 +16,6 @@ from mercurial import pycompat, util -if pycompat.ispy3: - - def set_noninheritable(fd): - # On Python 3, file descriptors are non-inheritable by default. - pass - - -else: - if pycompat.iswindows: - # unused - set_noninheritable = None - else: - import fcntl - - def set_noninheritable(fd): - old = fcntl.fcntl(fd, fcntl.F_GETFD) - fcntl.fcntl(fd, fcntl.F_SETFD, old | fcntl.FD_CLOEXEC) - - TEST_BUFFERING_CHILD_SCRIPT = r''' import os @@ -127,10 +108,6 @@ @contextlib.contextmanager def _pipes(): rwpair = os.pipe() - # Pipes are already non-inheritable on Windows. - if not pycompat.iswindows: - set_noninheritable(rwpair[0]) - set_noninheritable(rwpair[1]) with _closing(rwpair): yield rwpair @@ -143,8 +120,6 @@ import tty rwpair = pty.openpty() - set_noninheritable(rwpair[0]) - set_noninheritable(rwpair[1]) with _closing(rwpair): tty.setraw(rwpair[0]) yield rwpair