Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions Lib/test/_test_multiprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,11 @@ def _resource_unlink(name, rtype):

WAIT_ACTIVE_CHILDREN_TIMEOUT = 5.0

HAVE_GETVALUE = not getattr(_multiprocessing,
'HAVE_BROKEN_SEM_GETVALUE', False)
try:
HAVE_GETVALUE = not getattr(_multiprocessing,'flags') \
.get('HAVE_BROKEN_SEM_GETVALUE', False)
except:
HAVE_GETVALUE = True

WIN32 = (sys.platform == "win32")

Expand Down Expand Up @@ -1752,9 +1755,9 @@ def test_bounded_semaphore(self):
sem = self.BoundedSemaphore(2)
self._test_semaphore(sem)
# Currently fails on OS/X
#if HAVE_GETVALUE:
# self.assertRaises(ValueError, sem.release)
# self.assertReturnsIfImplemented(2, get_value, sem)
if HAVE_GETVALUE:
self.assertRaises(ValueError, sem.release)
self.assertReturnsIfImplemented(2, get_value, sem)

def test_timeout(self):
if self.TYPE != 'processes':
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the calculation of constant HAVE_GETVALUE in `test._test_multiprocessing.py` file.
Loading