mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
GH-94736: Fix _multiprocessing.SemLock subclassing (GH-94738)
* fix allocator and deallocator
* 📜🤖 Added by blurb_it.
* code review
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit f5b76330cf)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
This commit is contained in:
parent
b87d03d355
commit
916686fdb2
3 changed files with 14 additions and 4 deletions
|
|
@ -5964,3 +5964,14 @@ def tearDownModule():
|
|||
|
||||
remote_globs['setUpModule'] = setUpModule
|
||||
remote_globs['tearDownModule'] = tearDownModule
|
||||
|
||||
|
||||
@unittest.skipIf(not hasattr(_multiprocessing, 'SemLock'), 'SemLock not available')
|
||||
class SemLockTests(unittest.TestCase):
|
||||
|
||||
def test_semlock_subclass(self):
|
||||
class SemLock(_multiprocessing.SemLock):
|
||||
pass
|
||||
name = f'test_semlock_subclass-{os.getpid()}'
|
||||
s = SemLock(1, 0, 10, name, 0)
|
||||
_multiprocessing.sem_unlink(name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue