]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45919: Remove out of date comment (GH-30090)
authorDong-hee Na <donghee.na@python.org>
Tue, 14 Dec 2021 01:31:41 +0000 (10:31 +0900)
committerGitHub <noreply@github.com>
Tue, 14 Dec 2021 01:31:41 +0000 (10:31 +0900)
Python/pylifecycle.c

index 22281a311918e75e348cf626bbb6c6c634a2c4c9..b2f58f4e3e8a33e965ce09d7512706815e466e99 100644 (file)
@@ -2166,13 +2166,15 @@ is_valid_fd(int fd)
    some platforms.
 
    fcntl(fd, F_GETFD) is even faster, because it only checks the process table.
+   It is preferred over dup() when available, since it cannot fail with the
+   "too many open files" error (EMFILE).
 
    bpo-30225: On macOS Tiger, when stdout is redirected to a pipe and the other
    side of the pipe is closed, dup(1) succeed, whereas fstat(1, &st) fails with
    EBADF. FreeBSD has similar issue (bpo-32849).
 
-   Only use dup() on platforms where dup() is enough to detect invalid FD in
-   corner cases: on Linux and Windows (bpo-32849).
+   Only use dup() on Linux where dup() is enough to detect invalid FD
+   (bpo-32849).
 */
     if (fd < 0) {
         return 0;