Make fakelibvirt python2.6 compatible
Fix bug #893757. In Python 2.6 xml.etree.ElementTree.fromstring raises xml.parsers.expat.ExpatError instead of xml.etree.ElementTree.ParseError when faced with invalid xml. Adjust accordingly. Change-Id: I1e4ae532e001618bded2b60e554915e5d6f7e038
This commit is contained in:
parent
e453535511
commit
6d43ff7fa8
|
@ -15,7 +15,11 @@
|
|||
# under the License.
|
||||
|
||||
from xml.etree.ElementTree import fromstring as xml_to_tree
|
||||
from xml.etree.ElementTree import ParseError
|
||||
try:
|
||||
from xml.etree.ElementTree import ParseError
|
||||
except ImportError:
|
||||
from xml.parsers.expat import ExpatError as ParseError
|
||||
|
||||
import uuid
|
||||
|
||||
# Allow passing None to the various connect methods
|
||||
|
|
Loading…
Reference in New Issue