summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-02-19 20:27:19 -0800
committerLance Stout <lancestout@gmail.com>2012-02-19 20:27:19 -0800
commitc36073b40e2caef337511fa3a4e386dce5449bd2 (patch)
treeb8a8373fda58dbeea29e3d3d357e839b77e26efd /sleekxmpp/xmlstream
parentafe0d16797db0d895c8779d378cb9ca1a6a7f39c (diff)
downloadslixmpp-c36073b40e2caef337511fa3a4e386dce5449bd2.tar.gz
slixmpp-c36073b40e2caef337511fa3a4e386dce5449bd2.tar.bz2
slixmpp-c36073b40e2caef337511fa3a4e386dce5449bd2.tar.xz
slixmpp-c36073b40e2caef337511fa3a4e386dce5449bd2.zip
xml.etree.ElementTree raises ExpatError instead of SyntaxError or ParseError.
Diffstat (limited to 'sleekxmpp/xmlstream')
-rw-r--r--sleekxmpp/xmlstream/xmlstream.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py
index f626eb00..4c4b1ebb 100644
--- a/sleekxmpp/xmlstream/xmlstream.py
+++ b/sleekxmpp/xmlstream/xmlstream.py
@@ -31,6 +31,8 @@ try:
except ImportError:
import Queue as queue
+from xml.parsers.expat import ExpatError
+
import sleekxmpp
from sleekxmpp.thirdparty.statemachine import StateMachine
from sleekxmpp.xmlstream import Scheduler, tostring
@@ -1241,7 +1243,7 @@ class XMLStream(object):
except SystemExit:
log.debug("SystemExit in _process")
shutdown = True
- except SyntaxError as e:
+ except (SyntaxError, ExpatError) as e:
log.error("Error reading from XML stream.")
self.exception(e)
except Socket.error as serr: