Skip to content

Commit 9130a4d

Browse files
authored
bpo-45919: Remove out of date comment (GH-30090)
1 parent 121f1f8 commit 9130a4d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Python/pylifecycle.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2166,13 +2166,15 @@ is_valid_fd(int fd)
21662166
some platforms.
21672167
21682168
fcntl(fd, F_GETFD) is even faster, because it only checks the process table.
2169+
It is preferred over dup() when available, since it cannot fail with the
2170+
"too many open files" error (EMFILE).
21692171
21702172
bpo-30225: On macOS Tiger, when stdout is redirected to a pipe and the other
21712173
side of the pipe is closed, dup(1) succeed, whereas fstat(1, &st) fails with
21722174
EBADF. FreeBSD has similar issue (bpo-32849).
21732175
2174-
Only use dup() on platforms where dup() is enough to detect invalid FD in
2175-
corner cases: on Linux and Windows (bpo-32849).
2176+
Only use dup() on Linux where dup() is enough to detect invalid FD
2177+
(bpo-32849).
21762178
*/
21772179
if (fd < 0) {
21782180
return 0;

0 commit comments

Comments
 (0)