summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-06-20 16:27:55 -0700
committerLance Stout <lancestout@gmail.com>2011-06-20 16:27:55 -0700
commitfa716457a5cc8abf207e1da903202398dfb26878 (patch)
treecb10108eb4d19c30387fc22c5d53a96e3f80431f /sleekxmpp/xmlstream
parent4efd41f1ba679348487e1e88b7426830e92a9f9b (diff)
parentd8d9e8df16c07bd13bbac72e4445a2930407b244 (diff)
downloadslixmpp-fa716457a5cc8abf207e1da903202398dfb26878.tar.gz
slixmpp-fa716457a5cc8abf207e1da903202398dfb26878.tar.bz2
slixmpp-fa716457a5cc8abf207e1da903202398dfb26878.tar.xz
slixmpp-fa716457a5cc8abf207e1da903202398dfb26878.zip
Merge branch 'develop' into stream_features
Diffstat (limited to 'sleekxmpp/xmlstream')
-rw-r--r--sleekxmpp/xmlstream/xmlstream.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py
index 5bc71f04..6282c8d0 100644
--- a/sleekxmpp/xmlstream/xmlstream.py
+++ b/sleekxmpp/xmlstream/xmlstream.py
@@ -944,13 +944,14 @@ class XMLStream(object):
func -- The event handler to execute.
args -- Arguments to the event handler.
"""
+ orig = copy.copy(args[0])
try:
func(*args)
except Exception as e:
error_msg = 'Error processing event handler: %s'
log.exception(error_msg % str(func))
- if hasattr(args[0], 'exception'):
- args[0].exception(e)
+ if hasattr(orig, 'exception'):
+ orig.exception(e)
def _event_runner(self):
"""
@@ -973,6 +974,7 @@ class XMLStream(object):
etype, handler = event[0:2]
args = event[2:]
+ orig = copy.copy(args[0])
if etype == 'stanza':
try:
@@ -980,7 +982,7 @@ class XMLStream(object):
except Exception as e:
error_msg = 'Error processing stream handler: %s'
log.exception(error_msg % handler.name)
- args[0].exception(e)
+ orig.exception(e)
elif etype == 'schedule':
try:
log.debug('Scheduled event: %s' % args)
@@ -989,6 +991,7 @@ class XMLStream(object):
log.exception('Error processing scheduled task')
elif etype == 'event':
func, threaded, disposable = handler
+ orig = copy.copy(args[0])
try:
if threaded:
x = threading.Thread(
@@ -1001,8 +1004,8 @@ class XMLStream(object):
except Exception as e:
error_msg = 'Error processing event handler: %s'
log.exception(error_msg % str(func))
- if hasattr(args[0], 'exception'):
- args[0].exception(e)
+ if hasattr(orig, 'exception'):
+ orig.exception(e)
elif etype == 'quit':
log.debug("Quitting event runner thread")
return False