mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
gh-99509: Add __class_getitem__
to multiprocessing.queues.Queue
(#99511)
This commit is contained in:
parent
199507b81a
commit
ce39aaffee
3 changed files with 9 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue