mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #23524: Replace _PyVerify_fd function with calls to _set_thread_local_invalid_parameter_handler.
This commit is contained in:
parent
fe0a41aae4
commit
8fc8980c96
11 changed files with 150 additions and 69 deletions
|
@ -1325,11 +1325,13 @@ new_mmap_object(PyTypeObject *type, PyObject *args, PyObject *kwdict)
|
|||
*/
|
||||
if (fileno != -1 && fileno != 0) {
|
||||
/* Ensure that fileno is within the CRT's valid range */
|
||||
if (_PyVerify_fd(fileno) == 0) {
|
||||
if (!_PyVerify_fd(fileno)) {
|
||||
PyErr_SetFromErrno(PyExc_OSError);
|
||||
return NULL;
|
||||
}
|
||||
_Py_BEGIN_SUPPRESS_IPH
|
||||
fh = (HANDLE)_get_osfhandle(fileno);
|
||||
_Py_END_SUPPRESS_IPH
|
||||
if (fh==(HANDLE)-1) {
|
||||
PyErr_SetFromErrno(PyExc_OSError);
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue