diff options
author | Alexey Izbyshev <izbyshev@ispras.ru> | 2023-03-04 14:24:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-04 14:24:08 (GMT) |
commit | c2bd55d26f8eb2850eb9f9026b5d7f0ed1420b65 (patch) | |
tree | 3ee28c21d2a1654ac64cbbf8c47cfa4e5401f296 /Modules/posixmodule.c | |
parent | 705487c6557c3d8866622b4d32528bf7fc2e4204 (diff) | |
download | cpython-c2bd55d26f8eb2850eb9f9026b5d7f0ed1420b65.zip cpython-c2bd55d26f8eb2850eb9f9026b5d7f0ed1420b65.tar.gz cpython-c2bd55d26f8eb2850eb9f9026b5d7f0ed1420b65.tar.bz2 |
gh-102179: Fix `os.dup2` error reporting for negative fds (#102180)
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 937233a..7beb2ce 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -9795,11 +9795,6 @@ os_dup2_impl(PyObject *module, int fd, int fd2, int inheritable) static int dup3_works = -1; #endif - if (fd < 0 || fd2 < 0) { - posix_error(); - return -1; - } - /* dup2() can fail with EINTR if the target FD is already open, because it * then has to be closed. See os_close_impl() for why we don't handle EINTR * upon close(), and therefore below. |