SCons: Ensure written files are properly flushed/closed

This broke at least the generation of AndroidManifest.xml with Python 3.13.1.
This commit is contained in:
Rémi Verschelde 2025-01-03 12:22:48 +01:00
parent 69d43053de
commit e6b0829d76
No known key found for this signature in database
GPG key ID: C3336907360768E1
6 changed files with 13 additions and 0 deletions

View file

@ -43,6 +43,7 @@ def build_shader_header(target, source, env):
line = fs.readline()
fd.write(";\n")
fd.close()
return 0
@ -1105,6 +1106,7 @@ def update_version():
f.write("#define VERSION_STATUS " + str(version.status) + "\n")
import datetime
f.write("#define VERSION_YEAR " + str(datetime.datetime.now().year) + "\n")
f.close()
def parse_cg_file(fname, uniforms, sizes, conditionals):
@ -1175,6 +1177,7 @@ def build_cg_shader(sname):
fd.write('\t\tVP_%s,\n' % vp_uniforms[i].upper())
fd.write("\t};\n")
fd.close()
import glob
@ -1230,6 +1233,7 @@ void unregister_module_types() {
f = open("modules/register_module_types.gen.cpp", "w")
f.write(modules_cpp)
f.close()
return module_list
@ -1464,6 +1468,7 @@ def save_active_platforms(apnames, ap):
wf = x + "/logo.gen.h"
logow = open(wf, "w")
logow.write(str)
logow.close()
def no_verbose(sys, env):