[Python-checkins] FIX failure on OSX sem_getvalue (#6180)

Antoine Pitrou webhook-mailer at python.org
Wed Mar 21 13:56:34 EDT 2018


https://github.com/python/cpython/commit/dec1c7786f642049c2508e909442189dc043b5da
commit: dec1c7786f642049c2508e909442189dc043b5da
branch: master
author: Thomas Moreau <thomas.moreau.2010 at gmail.com>
committer: Antoine Pitrou <pitrou at free.fr>
date: 2018年03月21日T18:56:27+01:00
summary:
FIX failure on OSX sem_getvalue (#6180)
files:
A Misc/NEWS.d/next/Library/2018-03-21-17-59-39.bpo-33078.PQOniT.rst
M Lib/test/_test_multiprocessing.py
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index c787702f1d4c..c6a1f5ca9051 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -1062,11 +1062,16 @@ def __reduce__(self):
 q = self.Queue(maxsize=1)
 q.put(NotSerializable())
 q.put(True)
- self.assertEqual(q.qsize(), 1)
+ try:
+ self.assertEqual(q.qsize(), 1)
+ except NotImplementedError:
+ # qsize is not available on all platform as it
+ # relies on sem_getvalue
+ pass
 # bpo-30595: use a timeout of 1 second for slow buildbots
 self.assertTrue(q.get(timeout=1.0))
 # Check that the size of the queue is correct
- self.assertEqual(q.qsize(), 0)
+ self.assertTrue(q.empty())
 close_queue(q)
 
 def test_queue_feeder_on_queue_feeder_error(self):
diff --git a/Misc/NEWS.d/next/Library/2018-03-21-17-59-39.bpo-33078.PQOniT.rst b/Misc/NEWS.d/next/Library/2018-03-21-17-59-39.bpo-33078.PQOniT.rst
new file mode 100644
index 000000000000..8b71bb32e0ec
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2018-03-21-17-59-39.bpo-33078.PQOniT.rst
@@ -0,0 +1 @@
+Fix the failure on OSX caused by the tests relying on sem_getvalue


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /