diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2021-04-25 13:40:44 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-25 13:40:44 +0300 |
| commit | 172c0f2752d8708b6dda7b42e6c5a3519420a4e8 (patch) | |
| tree | 35a076c6baad7ca053a62b9f505af3762a867b79 /Lib/asyncio/futures.py | |
| parent | face87c94e67ad9c72b9a3724f112fd76c1002b9 (diff) | |
| download | cpython-git-172c0f2752d8708b6dda7b42e6c5a3519420a4e8.tar.gz | |
bpo-39529: Deprecate creating new event loop in asyncio.get_event_loop() (GH-23554)
asyncio.get_event_loop() emits now a deprecation warning when it creates a new event loop.
In future releases it will became an alias of asyncio.get_running_loop().
Diffstat (limited to 'Lib/asyncio/futures.py')
| -rw-r--r-- | Lib/asyncio/futures.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/asyncio/futures.py b/Lib/asyncio/futures.py index 2d22ef66c9..10f8f0554e 100644 --- a/Lib/asyncio/futures.py +++ b/Lib/asyncio/futures.py @@ -76,7 +76,7 @@ class Future: the default event loop. """ if loop is None: - self._loop = events.get_event_loop() + self._loop = events._get_event_loop() else: self._loop = loop self._callbacks = [] @@ -408,7 +408,7 @@ def wrap_future(future, *, loop=None): assert isinstance(future, concurrent.futures.Future), \ f'concurrent.futures.Future is expected, got {future!r}' if loop is None: - loop = events.get_event_loop() + loop = events._get_event_loop() new_future = loop.create_future() _chain_future(future, new_future) return new_future |
