mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-27 19:19:54 +00:00
Fix Python3 issue with dict.has_key()
This commit is contained in:
parent
940e3eba35
commit
93a4a3f8a0
3 changed files with 20 additions and 19 deletions
|
@ -463,7 +463,7 @@ class RemoteSession(object):
|
||||||
key = "%s.%s" % (endpoint, name)
|
key = "%s.%s" % (endpoint, name)
|
||||||
log.debug("Registering call handler for %s (%s)." % (key, method))
|
log.debug("Registering call handler for %s (%s)." % (key, method))
|
||||||
with self._lock:
|
with self._lock:
|
||||||
if self._entries.has_key(key):
|
if key in self._entries:
|
||||||
raise KeyError("A handler for %s has already been regisered!" % endpoint)
|
raise KeyError("A handler for %s has already been regisered!" % endpoint)
|
||||||
self._entries[key] = JabberRPCEntry(endpoint, method)
|
self._entries[key] = JabberRPCEntry(endpoint, method)
|
||||||
return key
|
return key
|
||||||
|
|
2
sleekxmpp/thirdparty/mini_dateutil.py
vendored
2
sleekxmpp/thirdparty/mini_dateutil.py
vendored
|
@ -144,7 +144,7 @@ except:
|
||||||
if offsetmins == 0:
|
if offsetmins == 0:
|
||||||
return UTC
|
return UTC
|
||||||
|
|
||||||
if not _fixed_offset_tzs.has_key(offsetmins):
|
if not offsetmins in _fixed_offset_tzs:
|
||||||
if offsetmins < 0:
|
if offsetmins < 0:
|
||||||
sign = '-'
|
sign = '-'
|
||||||
absoff = -offsetmins
|
absoff = -offsetmins
|
||||||
|
|
|
@ -854,9 +854,10 @@ class XMLStream(object):
|
||||||
Event handlers and the send queue will be threaded
|
Event handlers and the send queue will be threaded
|
||||||
regardless of these parameters.
|
regardless of these parameters.
|
||||||
"""
|
"""
|
||||||
if kwargs.has_key('threaded') and kwargs.has_key('block'):
|
if 'threaded' in kwargs and 'block' in kwargs:
|
||||||
raise ValueError("process() called with both block and threaded arguments")
|
raise ValueError("process() called with both " + \
|
||||||
elif kwargs.has_key('block'):
|
"block and threaded arguments")
|
||||||
|
elif 'block' in kwargs:
|
||||||
threaded = not(kwargs.get('block', False))
|
threaded = not(kwargs.get('block', False))
|
||||||
else:
|
else:
|
||||||
threaded = kwargs.get('threaded', True)
|
threaded = kwargs.get('threaded', True)
|
||||||
|
|
Loading…
Reference in a new issue