Fix Python3 issue with dict.has_key()

This commit is contained in:
Lance Stout
2011-08-04 22:34:34 -07:00
parent 940e3eba35
commit 93a4a3f8a0
3 changed files with 20 additions and 19 deletions

View File

@@ -854,13 +854,14 @@ class XMLStream(object):
Event handlers and the send queue will be threaded
regardless of these parameters.
"""
if kwargs.has_key('threaded') and kwargs.has_key('block'):
raise ValueError("process() called with both block and threaded arguments")
elif kwargs.has_key('block'):
if 'threaded' in kwargs and 'block' in kwargs:
raise ValueError("process() called with both " + \
"block and threaded arguments")
elif 'block' in kwargs:
threaded = not(kwargs.get('block', False))
else:
threaded = kwargs.get('threaded', True)
self.scheduler.process(threaded=True)
def start_thread(name, target):