Skip to content

Commit 9c87ad2

Browse files
kaysokyShakeel Mohamed
authored andcommitted
Fix an import error that occurs in Python 2.6
1 parent e6fa192 commit 9c87ad2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

splunklib/binding.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@
3939

4040
from contextlib import contextmanager
4141

42-
from xml.etree.ElementTree import XML, ParseError
42+
from xml.etree.ElementTree import XML
43+
try:
44+
from xml.etree.ElementTree import ParseError
45+
except ImportError, e:
46+
from xml.parsers.expat import ExpatError as ParseError
4347

4448
from data import record
4549

0 commit comments

Comments
 (0)