File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -6726,8 +6726,10 @@ os_sched_get_priority_max_impl(PyObject *module, int policy)
67266726{
67276727 int max ;
67286728
6729+ /* make sure that errno is cleared before the call */
6730+ errno = 0 ;
67296731 max = sched_get_priority_max (policy );
6730- if (max < 0 )
6732+ if (max == -1 && errno )
67316733 return posix_error ();
67326734 return PyLong_FromLong (max );
67336735}
@@ -6745,8 +6747,12 @@ static PyObject *
67456747os_sched_get_priority_min_impl (PyObject * module , int policy )
67466748/*[clinic end generated code: output=7595c1138cc47a6d input=21bc8fa0d70983bf]*/
67476749{
6748- int min = sched_get_priority_min (policy );
6749- if (min < 0 )
6750+ int min ;
6751+
6752+ /* make sure that errno is cleared before the call */
6753+ errno = 0 ;
6754+ min = sched_get_priority_min (policy );
6755+ if (min == -1 && errno )
67506756 return posix_error ();
67516757 return PyLong_FromLong (min );
67526758}
You can’t perform that action at this time.
0 commit comments