diff options
author | Steve Dower <steve.dower@microsoft.com> | 2015-04-12 00:26:27 -0400 |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2015-04-12 00:26:27 -0400 |
commit | e07a52f272f00b6707b40f557e481749b73dd0fd (patch) | |
tree | 3cabc848a69c94bc6f3c67ecc181eb917a7cc3db /Python/pylifecycle.c | |
parent | 652487fbda9903abe14257e157348074ffff75e0 (diff) | |
download | cpython-e07a52f272f00b6707b40f557e481749b73dd0fd.tar.gz |
Issue #23524: Replace _PyVerify_fd function with calls to _set_thread_local_invalid_parameter_handler.
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r-- | Python/pylifecycle.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index e5645494e6..56186778f4 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1068,11 +1068,12 @@ is_valid_fd(int fd) int dummy_fd; if (fd < 0 || !_PyVerify_fd(fd)) return 0; + _Py_BEGIN_SUPPRESS_IPH dummy_fd = dup(fd); - if (dummy_fd < 0) - return 0; - close(dummy_fd); - return 1; + if (dummy_fd >= 0) + close(dummy_fd); + _Py_END_SUPPRESS_IPH + return dummy_fd >= 0; } /* Initialize sys.stdin, stdout, stderr and builtins.open */ |