Material: py2 fix in depreciated mat file parser (back port from 0.19)

This commit is contained in:
Bernd Hahnebach
2019-08-26 08:31:49 +02:00
committed by GitHub
parent 7320c4c448
commit 1e9f9faa24
+6 -1
View File
@@ -20,6 +20,8 @@
# * *
# ***************************************************************************
import sys
# here the usage description if you use this tool from the command line ("__main__")
CommandlineUsage = """Material - Tool to work with FreeCAD Material definition cards
@@ -62,7 +64,10 @@ def importFCMat(fileName):
Config = configparser.RawConfigParser()
Config.optionxform = str
Config.read(fileName, encoding='utf-8') # respect unicode filenames
if sys.version_info.major >= 3:
Config.read(fileName, encoding='utf-8') # respect unicode filenames
else:
Config.read(fileName)
dict1 = {}
for section in Config.sections():
options = Config.options(section)