SCons: Ensure written files are properly flushed/closed

Also add `core/method_bind_ext.inc` to `.gitignore`.

(cherry picked from commit ad2fb7d93b)
This commit is contained in:
Rémi Verschelde
2025-01-03 22:44:20 +01:00
parent 8ee6e3848e
commit c47810c33b
8 changed files with 19 additions and 10 deletions

View File

@ -42,6 +42,7 @@ def build_shader_header( target, source, env ):
line=fs.readline()
fd.write(";\n")
fd.close()
return 0
@ -1098,6 +1099,7 @@ def update_version():
f.write("#define VERSION_MINOR "+str(version.minor)+"\n")
f.write("#define VERSION_REVISION "+str(rev)+"\n")
f.write("#define VERSION_STATUS "+str(version.status)+"\n")
f.close()
def parse_cg_file(fname, uniforms, sizes, conditionals):
@ -1167,7 +1169,7 @@ def build_cg_shader(sname):
fd.write('\t\tVP_%s,\n' % vp_uniforms[i].upper())
fd.write("\t};\n");
fd.close()
import glob
@ -1219,6 +1221,7 @@ void unregister_module_types() {
f=open("modules/register_module_types.cpp","wb")
f.write(modules_cpp)
f.close()
return module_list
@ -1323,6 +1326,7 @@ def save_active_platforms(apnames,ap):
wf = x+"/logo.h"
logow = open(wf,"wb")
logow.write(str)
logow.close()
def colored(sys,env):

View File

@ -59,6 +59,7 @@ manifest = manifest.replace("$$ADD_APPLICATION_CHUNKS$$",env.android_manifest_ch
manifest = manifest.replace("$$ADD_PERMISSION_CHUNKS$$",env.android_permission_chunk)
manifest = manifest.replace("$$ADD_APPATTRIBUTE_CHUNKS$$",env.android_appattributes_chunk)
pp_baseout.write( manifest )
pp_baseout.close()
for x in env.android_source_files:

View File

@ -205,4 +205,4 @@ for c in list(new_doc):
write_class(c)
write_string(f,'</doc>\n')
f.close()

View File

@ -75,6 +75,7 @@ def make_class_list(class_list,columns):
s+="\n"
f.write(s)
f.close()
def dokuize_text(txt):
@ -220,7 +221,7 @@ def make_method(f,name,m,declare,event=False):
s+=" "+m.attrib["qualifiers"]
f.write(s+"\n")
f.close()
def make_doku_class(node):
@ -302,8 +303,7 @@ def make_doku_class(node):
f.write(dokuize_text(d.text.strip()))
f.write("\n")
f.close()
"""

View File

@ -85,6 +85,7 @@ def make_class_list(class_list, columns):
s += '\n'
f.write(s)
f.close()
def dokuize_text(txt):
@ -317,6 +318,7 @@ def make_doku_class(node):
f.write('\n')
f.write(dokuize_text(d.text.strip()))
f.write('\n')
f.close()
for file in input_list:

View File

@ -23,6 +23,7 @@ def make_doc_header(target,source,env):
g.write(str(ord(buf[i]))+",\n")
g.write("};\n")
g.write("#endif")
g.close()

View File

@ -1656,6 +1656,7 @@ class DaeExporter:
f.write(bytes('\t<instance_visual_scene url="#'+self.scene_name+'" />\n',"UTF-8"))
f.write(bytes('</scene>\n',"UTF-8"))
f.write(bytes('</COLLADA>\n',"UTF-8"))
f.close()
return True
def __init__(self,path,kwargs,operator):

View File

@ -157,6 +157,7 @@ f.write("void glWrapperInit( GLWrapperFuncPtr (*wrapperFunc)(const char*) );\n")
f.write("#ifdef __cplusplus\n}\n#endif\n")
f.write("#endif\n\n")
f.close()
f=open("glwrapper.c","w")
@ -177,8 +178,7 @@ for x in functions:
f.write("\n\n")
f.write("}\n")
f.write("\n\n")
f.close()