diff options
author | Lance Stout <lancestout@gmail.com> | 2011-05-31 12:48:43 -0700 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2011-06-01 15:17:22 -0700 |
commit | 8aa4396e4490a964e3e1b1a5e6f555e97c16fd3d (patch) | |
tree | ed58dc66611c99710a404fe5795f9f3d4364f777 /sleekxmpp/clientxmpp.py | |
parent | 14693233504383d4df0ed092c870d5d7baea6538 (diff) | |
download | slixmpp-8aa4396e4490a964e3e1b1a5e6f555e97c16fd3d.tar.gz slixmpp-8aa4396e4490a964e3e1b1a5e6f555e97c16fd3d.tar.bz2 slixmpp-8aa4396e4490a964e3e1b1a5e6f555e97c16fd3d.tar.xz slixmpp-8aa4396e4490a964e3e1b1a5e6f555e97c16fd3d.zip |
Begin experimental use of exceptions.
Provides IqTimeout and IqError which are raised when an Iq response
does not arrive in time, or it arrives with type='error'.
Diffstat (limited to 'sleekxmpp/clientxmpp.py')
-rw-r--r-- | sleekxmpp/clientxmpp.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sleekxmpp/clientxmpp.py b/sleekxmpp/clientxmpp.py index fb5b2087..77710541 100644 --- a/sleekxmpp/clientxmpp.py +++ b/sleekxmpp/clientxmpp.py @@ -231,8 +231,8 @@ class ClientXMPP(BaseXMPP): 'subscription': subscription, 'groups': groups}} response = iq.send(block, timeout, callback) - if response in [False, None] or not isinstance(response, Iq): - return response + if response is None: + return None return response['type'] == 'result' def del_roster_item(self, jid): @@ -265,12 +265,7 @@ class ClientXMPP(BaseXMPP): iq.enable('roster') response = iq.send(block, timeout, callback) - if response == False: - self.event('roster_timeout') - - if response in [False, None] or not isinstance(response, Iq): - return response - else: + if callback is None: return self._handle_roster(response, request=True) def _handle_stream_features(self, features): |