Skip to content

gh-155445: Fix the calculation of constant HAVE_GETVALUE in test._test_multiprocessing. - #155540

Open
YvesDup wants to merge 2 commits into
python:mainfrom
YvesDup:have_getvalue-failed-test-multiprocessing
Open

gh-155445: Fix the calculation of constant HAVE_GETVALUE in test._test_multiprocessing. #155540
YvesDup wants to merge 2 commits into
python:mainfrom
YvesDup:have_getvalue-failed-test-multiprocessing

Conversation

@YvesDup

@YvesDup YvesDup commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Fix the calculation of this constant getting the value from flags dictionary if it is present in the attributes of _multiprocessing module.

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

Reactivate the second part of test_bounded_semaphore test.

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)

- Fix the calculation of the HAVE_GETVALUE constant
- Enabled the second part of ``test_bounded_semphore``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant