Skip to content

Commit 64eb259

Browse files
authored
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.
1 parent ba06a70 commit 64eb259

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/posixmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8782,6 +8782,7 @@ void
87828782
_Py_closerange(int first, int last)
87838783
{
87848784
first = Py_MAX(first, 0);
8785+
_Py_BEGIN_SUPPRESS_IPH
87858786
#ifdef HAVE_CLOSE_RANGE
87868787
if (close_range(first, last, 0) == 0 || errno != ENOSYS) {
87878788
/* Any errors encountered while closing file descriptors are ignored;
@@ -8812,6 +8813,7 @@ _Py_closerange(int first, int last)
88128813
}
88138814
}
88148815
#endif /* USE_FDWALK */
8816+
_Py_END_SUPPRESS_IPH
88158817
}
88168818

88178819
/*[clinic input]
@@ -8829,9 +8831,7 @@ os_closerange_impl(PyObject *module, int fd_low, int fd_high)
88298831
/*[clinic end generated code: output=0ce5c20fcda681c2 input=5855a3d053ebd4ec]*/
88308832
{
88318833
Py_BEGIN_ALLOW_THREADS
8832-
_Py_BEGIN_SUPPRESS_IPH
88338834
_Py_closerange(fd_low, fd_high - 1);
8834-
_Py_END_SUPPRESS_IPH
88358835
Py_END_ALLOW_THREADS
88368836
Py_RETURN_NONE;
88378837
}

0 commit comments

Comments
 (0)