summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/events.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2023-01-10 20:20:09 (GMT)
committerGitHub <noreply@github.com>2023-01-10 20:20:09 (GMT)
commit1b2459dc64b1c3eea89312ea9bf422f8d7c75bb2 (patch)
tree41d9dcee517a54ff3949be8b70e76381fe72ac81 /Lib/asyncio/events.py
parenta7f9afdd465886ad6fce94e34f1ebff8730a3faa (diff)
downloadcpython-1b2459dc64b1c3eea89312ea9bf422f8d7c75bb2.zip
cpython-1b2459dc64b1c3eea89312ea9bf422f8d7c75bb2.tar.gz
cpython-1b2459dc64b1c3eea89312ea9bf422f8d7c75bb2.tar.bz2
[3.11] gh-100160: Remove any deprecation warnings in asyncio.get_event_loop() (#100412)
Some deprecation warnings will reappear (in a slightly different form) in 3.12. Co-authored-by: Guido van Rossum <guido@python.org>
Diffstat (limited to 'Lib/asyncio/events.py')
-rw-r--r--Lib/asyncio/events.py15
1 files changed, 0 insertions, 15 deletions
diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py
index af3f9e9..b179932 100644
--- a/Lib/asyncio/events.py
+++ b/Lib/asyncio/events.py
@@ -671,21 +671,6 @@ class BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy):
if (self._local._loop is None and
not self._local._set_called and
threading.current_thread() is threading.main_thread()):
- stacklevel = 2
- try:
- f = sys._getframe(1)
- except AttributeError:
- pass
- else:
- while f:
- module = f.f_globals.get('__name__')
- if not (module == 'asyncio' or module.startswith('asyncio.')):
- break
- f = f.f_back
- stacklevel += 1
- import warnings
- warnings.warn('There is no current event loop',
- DeprecationWarning, stacklevel=stacklevel)
self.set_event_loop(self.new_event_loop())
if self._local._loop is None: