File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7794,8 +7794,10 @@ os_sched_get_priority_max_impl(PyObject *module, int policy)
77947794{
77957795 int max ;
77967796
7797+ /* make sure that errno is cleared before the call */
7798+ errno = 0 ;
77977799 max = sched_get_priority_max (policy );
7798- if (max == -1 )
7800+ if (max == -1 && errno )
77997801 return posix_error ();
78007802 return PyLong_FromLong (max );
78017803}
@@ -7813,8 +7815,12 @@ static PyObject *
78137815os_sched_get_priority_min_impl (PyObject * module , int policy )
78147816/*[clinic end generated code: output=7595c1138cc47a6d input=21bc8fa0d70983bf]*/
78157817{
7816- int min = sched_get_priority_min (policy );
7817- if (min == -1 )
7818+ int min ;
7819+
7820+ /* make sure that errno is cleared before the call */
7821+ errno = 0 ;
7822+ min = sched_get_priority_min (policy );
7823+ if (min == -1 && errno )
78187824 return posix_error ();
78197825 return PyLong_FromLong (min );
78207826}
You can’t perform that action at this time.
0 commit comments