@@ -930,17 +930,17 @@ def test_get_and_set_scheduler_and_param(self):
930930 self .assertRaises (OSError , posix .sched_getparam , - 1 )
931931 param = posix .sched_getparam (0 )
932932 self .assertIsInstance (param .sched_priority , int )
933- try :
934- posix .sched_setscheduler (0 , mine , param )
935- except OSError as e :
936- if e .errno != errno .EPERM :
937- raise
938933
939- # POSIX states that calling sched_setparam() on a process with a
940- # scheduling policy other than SCHED_FIFO or SCHED_RR is
941- # implementation-defined: FreeBSD returns EINVAL.
942- if not sys .platform .startswith ('freebsd' ):
943- posix .sched_setparam (0 , param )
934+ # POSIX states that calling sched_setparam() or sched_setscheduler() on
935+ # a process with a scheduling policy other than SCHED_FIFO or SCHED_RR
936+ # is implementation-defined: NetBSD and FreeBSD can return EINVAL.
937+ if not sys .platform .startswith (('freebsd' , 'netbsd' )):
938+ try :
939+ posix .sched_setscheduler (0 , mine , param )
940+ posix .sched_setparam (0 , param )
941+ except OSError as e :
942+ if e .errno != errno .EPERM :
943+ raise
944944 self .assertRaises (OSError , posix .sched_setparam , - 1 , param )
945945
946946 self .assertRaises (OSError , posix .sched_setscheduler , - 1 , mine , param )
0 commit comments