py3: OpenSCAD: use io.open more explicit

This commit is contained in:
Clemens Weissbacher
2018-10-29 17:17:53 +01:00
parent 04372041e1
commit befb3ea8a8
3 changed files with 8 additions and 11 deletions

View File

@@ -50,7 +50,9 @@ convexity = 'convexity = %d' % conv
#***************************************************************************
# Radius values not fixed for value apart from cylinder & Cone
# no doubt there will be a problem when they do implement Value
pythonopen = open
if open.__module__ in ['__builtin__', 'io']:
pythonopen = open # to distinguish python built-in open function from the one declared here
def center(b):
if b == 2:
@@ -247,7 +249,7 @@ def export(exportList,filename):
# process Objects
print("\nStart Export 0.1d\n")
print("Open Output File")
csg = pythonopen(filename,'w', encoding="utf8")
csg = pythonopen(filename,'w')
print("Write Initial Output")
# Not sure if comments as per scad are allowed in csg file
csg.write("// CSG file generated from FreeCAD %s\n" % \