Skip to content

Commit

Permalink
Try fixing py26 test error.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-maier committed Dec 1, 2016
1 parent 3f002d1 commit 34526c2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pywbem/tupletree.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
import xml.dom.minidom
import xml.sax
import re
import sys
import six

__all__ = []

Expand Down Expand Up @@ -144,9 +144,11 @@ def xml_to_tupletree_sax(xml_string):

# The following is required because python version 3.4 does not accept
# str for the sax processor xml input.
if sys.version_info[0:2] == (3, 4):
if isinstance(xml_string, str):
xml_string = xml_string.encode("utf-8")
# if sys.version_info[0:2] == (3, 4):
# if isinstance(xml_string, str):
# xml_string = xml_string.encode("utf-8")
if isinstance(xml_string, six.text_type):
xml_string = xml_string.encode("utf-8")

xml.sax.parseString(xml_string, handler, None)
return handler.root

0 comments on commit 34526c2

Please sign in to comment.