Fix Python3 compatability

This commit is contained in:
James Turner 2020-03-24 14:26:34 +00:00
parent aff1ac0f69
commit 14ee759409

View File

@ -119,7 +119,7 @@ class Node(object):
# value and type specification # value and type specification
try: try:
if self._value is not None: if self._value is not None:
if isinstance(self._value, basestring): if isinstance(self._value, str):
# don't call str() on strings, breaks the # don't call str() on strings, breaks the
# encoding # encoding
n.text = self._value n.text = self._value
@ -135,7 +135,7 @@ class Node(object):
except UnicodeEncodeError: except UnicodeEncodeError:
print("Encoding error with %s %s" % (self._value, type(self._value))) print("Encoding error with %s %s" % (self._value, type(self._value)))
except: except:
print("Some other exceptiong in sgprops._createXMLElement()") print("Unexpected exception in sgprops._createXMLElement():", sys.exc_info()[0])
# index in parent # index in parent
if (self.index != 0): if (self.index != 0):