diff options
author | Maxime “pep” Buquet <pep@bouah.net> | 2019-04-24 23:22:45 +0100 |
---|---|---|
committer | Maxime “pep” Buquet <pep@bouah.net> | 2019-07-03 21:36:17 +0200 |
commit | 4435c81d77c651a20bfe979ed8d20f9887c057d1 (patch) | |
tree | b2e36e18987ef568a05fe908eb861a82b980a223 /slixmpp/xmlstream | |
parent | 2638ba2744317e9b7c51b181c8818b8b5d28606d (diff) | |
download | slixmpp-4435c81d77c651a20bfe979ed8d20f9887c057d1.tar.gz slixmpp-4435c81d77c651a20bfe979ed8d20f9887c057d1.tar.bz2 slixmpp-4435c81d77c651a20bfe979ed8d20f9887c057d1.tar.xz slixmpp-4435c81d77c651a20bfe979ed8d20f9887c057d1.zip |
xmlstream.disconnect: add compat behaviour, set wait to default `2.0` when True is passed. Update documentation
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
Diffstat (limited to 'slixmpp/xmlstream')
-rw-r--r-- | slixmpp/xmlstream/xmlstream.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py index 98b0744c..f386d6a6 100644 --- a/slixmpp/xmlstream/xmlstream.py +++ b/slixmpp/xmlstream/xmlstream.py @@ -478,6 +478,13 @@ class XMLStream(asyncio.BaseProtocol): :param wait: Time to wait for a response from the server. """ + # Compat: docs/getting_started/sendlogout.rst has been promoting + # `disconnect(wait=True)` for ages. This doesn't mean anything to the + # schedule call below. It would fortunately be converted to `1` later + # down the call chain. Praise the implicit casts lord. + if wait == True: + wait = 2.0 + self.disconnect_reason = reason self.cancel_connection_attempt() if self.transport: |