summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorAlexey Izbyshev <izbyshev@ispras.ru>2023-03-04 14:24:08 (GMT)
committerGitHub <noreply@github.com>2023-03-04 14:24:08 (GMT)
commitc2bd55d26f8eb2850eb9f9026b5d7f0ed1420b65 (patch)
tree3ee28c21d2a1654ac64cbbf8c47cfa4e5401f296 /Modules/posixmodule.c
parent705487c6557c3d8866622b4d32528bf7fc2e4204 (diff)
downloadcpython-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.c5
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.