From 14ee759409af3f120bbe11bc7da2d861ece7efa2 Mon Sep 17 00:00:00 2001 From: James Turner Date: Tue, 24 Mar 2020 14:26:34 +0000 Subject: [PATCH] Fix Python3 compatability --- catalog/sgprops.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/catalog/sgprops.py b/catalog/sgprops.py index 32ed489..6bef21d 100644 --- a/catalog/sgprops.py +++ b/catalog/sgprops.py @@ -119,7 +119,7 @@ class Node(object): # value and type specification try: if self._value is not None: - if isinstance(self._value, basestring): + if isinstance(self._value, str): # don't call str() on strings, breaks the # encoding n.text = self._value @@ -135,7 +135,7 @@ class Node(object): except UnicodeEncodeError: print("Encoding error with %s %s" % (self._value, type(self._value))) except: - print("Some other exceptiong in sgprops._createXMLElement()") + print("Unexpected exception in sgprops._createXMLElement():", sys.exc_info()[0]) # index in parent if (self.index != 0):