FEM: elmer sifio, Python3 unicode fix

This commit is contained in:
Bernd Hahnebach
2018-02-15 07:48:59 +01:00
committed by Yorik van Havre
parent dbc7fe9c67
commit 6e4f79e47d

View File

@@ -22,6 +22,7 @@
import collections
import six
SIMULATION = "Simulation"
@@ -401,7 +402,7 @@ class _Writer(object):
def _preprocess(self, data, dataType):
if issubclass(dataType, Section):
return str(self._idMgr.getId(data))
if issubclass(dataType, str) or issubclass(dataType, unicode):
if issubclass(dataType, six.string_types): # use six to be sure to be Python 2.7 and 3.x compatible
return '"%s"' % data
return str(data)