summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_posix.py
diff options
context:
space:
mode:
authorMalcolm Smith <smith@chaquo.com>2024-02-29 21:32:50 (GMT)
committerGitHub <noreply@github.com>2024-02-29 21:32:50 (GMT)
commit41d5391c551e2012f13d56ff4bcc1df15c2821d3 (patch)
tree2767dd61f16e8519893a376ce4ec6452661dac16 /Lib/test/test_posix.py
parent83c5ecdeec80fbd1f667f234f626c4154d40ebb5 (diff)
downloadcpython-41d5391c551e2012f13d56ff4bcc1df15c2821d3.zip
cpython-41d5391c551e2012f13d56ff4bcc1df15c2821d3.tar.gz
cpython-41d5391c551e2012f13d56ff4bcc1df15c2821d3.tar.bz2
gh-71052: Add test exclusions to support running the test suite on Android (#115918)
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)