summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_posix.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r--Lib/test/test_posix.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index a45f620..2706d5e 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -1270,9 +1270,10 @@ class PosixTester(unittest.TestCase):
self.assertIn(mine, possible_schedulers)
try:
parent = posix.sched_getscheduler(os.getppid())
- except OSError as e:
- if e.errno != errno.EPERM:
- raise
+ except PermissionError:
+ # POSIX specifies EPERM, but Android returns EACCES. Both errno
+ # values are mapped to PermissionError.
+ pass
else:
self.assertIn(parent, possible_schedulers)
self.assertRaises(OSError, posix.sched_getscheduler, -1)
@@ -1287,9 +1288,8 @@ class PosixTester(unittest.TestCase):
try:
posix.sched_setscheduler(0, mine, param)
posix.sched_setparam(0, param)
- except OSError as e:
- if e.errno != errno.EPERM:
- raise
+ except PermissionError:
+ pass
self.assertRaises(OSError, posix.sched_setparam, -1, param)
self.assertRaises(OSError, posix.sched_setscheduler, -1, mine, param)