Skip to content

Commit f5625d5

Browse files
miss-islingtontomMoral
authored andcommitted
FIX failure on OSX sem_getvalue (GH-6180) (GH-6181)
(cherry picked from commit dec1c77) Co-authored-by: Thomas Moreau <[email protected]>
1 parent bb5b529 commit f5625d5

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Lib/test/_test_multiprocessing.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,11 +1062,16 @@ def __reduce__(self):
10621062
q = self.Queue(maxsize=1)
10631063
q.put(NotSerializable())
10641064
q.put(True)
1065-
self.assertEqual(q.qsize(), 1)
1065+
try:
1066+
self.assertEqual(q.qsize(), 1)
1067+
except NotImplementedError:
1068+
# qsize is not available on all platform as it
1069+
# relies on sem_getvalue
1070+
pass
10661071
# bpo-30595: use a timeout of 1 second for slow buildbots
10671072
self.assertTrue(q.get(timeout=1.0))
10681073
# Check that the size of the queue is correct
1069-
self.assertEqual(q.qsize(), 0)
1074+
self.assertTrue(q.empty())
10701075
close_queue(q)
10711076

10721077
def test_queue_feeder_on_queue_feeder_error(self):
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix the failure on OSX caused by the tests relying on sem_getvalue

0 commit comments

Comments
 (0)