deprecate XMLStream.process()

This commit is contained in:
mathieui 2022-02-15 21:57:49 +01:00
parent 92c3f69829
commit bcb4495c6d

View File

@ -32,8 +32,9 @@ import functools
import logging import logging
import socket as Socket import socket as Socket
import ssl import ssl
import weakref
import uuid import uuid
import warnings
import weakref
from contextlib import contextmanager from contextlib import contextmanager
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
@ -508,7 +509,17 @@ class XMLStream(asyncio.BaseProtocol):
timers, handling signal events, etc). If timeout is None, this timers, handling signal events, etc). If timeout is None, this
function will run forever. If timeout is a number, this function function will run forever. If timeout is a number, this function
will return after the given time in seconds. will return after the given time in seconds.
Will be removed in slixmpp 1.9.0
:deprecated: 1.8.0
""" """
warnings.warn(
'This function will be removed in slixmpp 1.9 and above.'
' Use the asyncio normal functions instead.',
category=DeprecationWarning,
stacklevel=2,
)
if timeout is None: if timeout is None:
if forever: if forever:
self.loop.run_forever() self.loop.run_forever()