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 @@ -6812,8 +6812,10 @@ os_sched_get_priority_max_impl(PyObject *module, int policy)
68126812{
68136813 int max ;
68146814
6815+ /* make sure that errno is cleared before the call */
6816+ errno = 0 ;
68156817 max = sched_get_priority_max (policy );
6816- if (max == -1 )
6818+ if (max == -1 && errno )
68176819 return posix_error ();
68186820 return PyLong_FromLong (max );
68196821}
@@ -6831,8 +6833,12 @@ static PyObject *
68316833os_sched_get_priority_min_impl (PyObject * module , int policy )
68326834/*[clinic end generated code: output=7595c1138cc47a6d input=21bc8fa0d70983bf]*/
68336835{
6834- int min = sched_get_priority_min (policy );
6835- if (min == -1 )
6836+ int min ;
6837+
6838+ /* make sure that errno is cleared before the call */
6839+ errno = 0 ;
6840+ min = sched_get_priority_min (policy );
6841+ if (min == -1 && errno )
68366842 return posix_error ();
68376843 return PyLong_FromLong (min );
68386844}
You can’t perform that action at this time.
0 commit comments