Skip to content

Commit ce4f291

Browse files
committed
Make multiprocessing.Queue a subclass of queue.Queue
Also change multiprocessing.Queue's put and get timeout arguments to allow None. This fixes a problem with logging.handlers.QueueHandler and QueueListener not accepting a multiprocessing.Queue as the queue argument.
1 parent b2df503 commit ce4f291

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

stdlib/3/multiprocessing/__init__.pyi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ from multiprocessing.managers import SyncManager
88
from multiprocessing.pool import AsyncResult
99
from multiprocessing.process import current_process as current_process
1010
import sys
11+
import queue
1112

1213
class Lock():
1314
def acquire(self, block: bool = ..., timeout: int = ...) -> None: ...
@@ -93,10 +94,10 @@ class Process():
9394
def is_alive(self) -> bool: ...
9495
def join(self, timeout: Optional[float] = ...) -> None: ...
9596

96-
class Queue():
97+
class Queue(queue.Queue):
9798
def __init__(self, maxsize: int = ...) -> None: ...
98-
def get(self, block: bool = ..., timeout: float = ...) -> Any: ...
99-
def put(self, item: Any, block: bool = ..., timeout: float = ...) -> None: ...
99+
def get(self, block: bool = ..., timeout: Optional[float] = ...) -> Any: ...
100+
def put(self, item: Any, block: bool = ..., timeout: Optional[float] = ...) -> None: ...
100101
def qsize(self) -> int: ...
101102
def empty(self) -> bool: ...
102103
def full(self) -> bool: ...

0 commit comments

Comments
 (0)