summaryrefslogtreecommitdiffstats
path: root/Modules/mmapmodule.c
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2015-04-12 04:26:27 (GMT)
committerSteve Dower <steve.dower@microsoft.com>2015-04-12 04:26:27 (GMT)
commit8fc8980c96f58a7f06e4e3133735807bd245c658 (patch)
tree04376ea1928a20c88b506e836ab82cc266cc85ae /Modules/mmapmodule.c
parentfe0a41aae425c61364b79c18ca8321dffed3ac40 (diff)
downloadcpython-8fc8980c96f58a7f06e4e3133735807bd245c658.zip
cpython-8fc8980c96f58a7f06e4e3133735807bd245c658.tar.gz
cpython-8fc8980c96f58a7f06e4e3133735807bd245c658.tar.bz2
Issue #23524: Replace _PyVerify_fd function with calls to _set_thread_local_invalid_parameter_handler.
Diffstat (limited to 'Modules/mmapmodule.c')
-rw-r--r--Modules/mmapmodule.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index e2ed5f9..c5ba4b7 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -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;