Merge branch 'deprecate-xmpp-process' into 'master'

deprecate XMLStream.process()

See merge request poezio/slixmpp!183
This commit is contained in:
mathieui 2022-02-16 21:26:03 +01:00
commit 98dba869c7

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()