gh-99509: Add __class_getitem__ to multiprocessing.queues.Queue (#99511)

This commit is contained in:
Nikita Sobolev 2022-12-27 07:50:55 +03:00 committed by GitHub
parent 199507b81a
commit ce39aaffee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View file

@ -31,11 +31,15 @@ try:
from multiprocessing.managers import ValueProxy
from multiprocessing.pool import ApplyResult
from multiprocessing.queues import SimpleQueue as MPSimpleQueue
from multiprocessing.queues import Queue as MPQueue
from multiprocessing.queues import JoinableQueue as MPJoinableQueue
except ImportError:
# _multiprocessing module is optional
ValueProxy = None
ApplyResult = None
MPSimpleQueue = None
MPQueue = None
MPJoinableQueue = None
try:
from multiprocessing.shared_memory import ShareableList
except ImportError:
@ -130,7 +134,8 @@ class BaseTest(unittest.TestCase):
if ctypes is not None:
generic_types.extend((ctypes.Array, ctypes.LibraryLoader))
if ValueProxy is not None:
generic_types.extend((ValueProxy, ApplyResult, MPSimpleQueue))
generic_types.extend((ValueProxy, ApplyResult,
MPSimpleQueue, MPQueue, MPJoinableQueue))
def test_subscriptable(self):
for t in self.generic_types: