summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorKyle Evans <kevans91@users.noreply.github.com>2020-10-12 23:53:16 (GMT)
committerGitHub <noreply@github.com>2020-10-12 23:53:16 (GMT)
commit64eb259cc1e42a5f74b5911a518d2c50daa8d50b (patch)
treecd2faa225b63dd721b9f3251ece6db4c6c92bca2 /Modules/posixmodule.c
parentba06a70c822ede62688136add488eb78957689fe (diff)
downloadcpython-64eb259cc1e42a5f74b5911a518d2c50daa8d50b.zip
cpython-64eb259cc1e42a5f74b5911a518d2c50daa8d50b.tar.gz
cpython-64eb259cc1e42a5f74b5911a518d2c50daa8d50b.tar.bz2
bpo-40422: Move _Py_*_SUPPRESS_IPH bits into _Py_closerange (GH-22672)
This suppression is no longer needed in os_closerange_impl, as it just invokes the internal _Py_closerange implementation. On the other hand, consumers of _Py_closerange may not have any other reason to suppress invalid parameter issues, so narrow the scope to here.
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r--Modules/posixmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 2e0caaa..de81db8 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -8782,6 +8782,7 @@ void
_Py_closerange(int first, int last)
{
first = Py_MAX(first, 0);
+ _Py_BEGIN_SUPPRESS_IPH
#ifdef HAVE_CLOSE_RANGE
if (close_range(first, last, 0) == 0 || errno != ENOSYS) {
/* Any errors encountered while closing file descriptors are ignored;
@@ -8812,6 +8813,7 @@ _Py_closerange(int first, int last)
}
}
#endif /* USE_FDWALK */
+ _Py_END_SUPPRESS_IPH
}
/*[clinic input]
@@ -8829,9 +8831,7 @@ os_closerange_impl(PyObject *module, int fd_low, int fd_high)
/*[clinic end generated code: output=0ce5c20fcda681c2 input=5855a3d053ebd4ec]*/
{
Py_BEGIN_ALLOW_THREADS
- _Py_BEGIN_SUPPRESS_IPH
_Py_closerange(fd_low, fd_high - 1);
- _Py_END_SUPPRESS_IPH
Py_END_ALLOW_THREADS
Py_RETURN_NONE;
}