so warnings are associated with the line where the deprecated methods are called
rather than the line where the warning itself is
This method also clears the current `asyncio` event loop.
.. deprecated:: 6.2
"""
- warnings.warn("clear_current is deprecated", DeprecationWarning)
+ warnings.warn(
+ "clear_current is deprecated",
+ DeprecationWarning,
+ stacklevel=2,
+ )
IOLoop._clear_current()
@staticmethod
warnings.warn(
"make_current is deprecated; start the event loop first",
DeprecationWarning,
+ stacklevel=2,
)
if not self.is_current:
try:
"AnyThreadEventLoopPolicy is deprecated, use asyncio.run "
"or asyncio.new_event_loop instead",
DeprecationWarning,
+ stacklevel=2,
)
def get_event_loop(self) -> asyncio.AbstractEventLoop: