FEM: utils, add a def to decode bytestrings in Py3

This commit is contained in:
Bernd Hahnebach
2018-12-19 19:31:34 +01:00
committed by wmayer
parent e629fd0b69
commit 4682cac73b

View File

@@ -27,6 +27,7 @@ __author__ = "Markus Hovorka, Bernd Hahnebach"
__url__ = "http://www.freecadweb.org"
import sys
import FreeCAD
import FreeCAD as App
@@ -166,3 +167,10 @@ def get_refshape_type(fem_doc_object):
else:
FreeCAD.Console.PrintMessage(fem_doc_object.Name + ' has empty References.\n')
return ''
def pydecode(bytestring):
if sys.version_info.major < 3:
return bytestring
else:
return bytestring.decode("utf-8")