mirror of
https://github.com/python/cpython.git
synced 2025-08-19 08:11:46 +00:00
bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs [queue] (GH-13950)
This PR deprecate explicit loop parameters in all public asyncio APIs
This issues is split to be easier to review.
fourth step: queue.py
https://bugs.python.org/issue36373
(cherry picked from commit 9008be303a
)
Co-authored-by: Emmanuel Arias <emmanuelarias30@gmail.com>
This commit is contained in:
parent
bb8fc8bd30
commit
55daf1a561
2 changed files with 8 additions and 0 deletions
|
@ -2,6 +2,7 @@ __all__ = ('Queue', 'PriorityQueue', 'LifoQueue', 'QueueFull', 'QueueEmpty')
|
|||
|
||||
import collections
|
||||
import heapq
|
||||
import warnings
|
||||
|
||||
from . import events
|
||||
from . import locks
|
||||
|
@ -34,6 +35,9 @@ class Queue:
|
|||
self._loop = events.get_event_loop()
|
||||
else:
|
||||
self._loop = loop
|
||||
warnings.warn("The loop argument is deprecated since Python 3.8, "
|
||||
"and scheduled for removal in Python 3.10.",
|
||||
DeprecationWarning, stacklevel=2)
|
||||
self._maxsize = maxsize
|
||||
|
||||
# Futures.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue