mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 04:06:14 +00:00
SCons: properly close files when reading controller mappings
Fixup to #17296.
This commit is contained in:
parent
f17c35b447
commit
cc617dc5d1
@ -74,8 +74,7 @@ def make_default_controller_mappings(target, source, env):
|
||||
platform_mappings = OrderedDict()
|
||||
for src in source:
|
||||
src_path = src.srcnode().abspath
|
||||
f = open(src_path, "rb")
|
||||
|
||||
with open(src_path, "rb") as f:
|
||||
# read mapping file and skip header
|
||||
mapping_file_lines = f.readlines()[2:]
|
||||
|
||||
@ -123,6 +122,7 @@ def make_default_controller_mappings(target, source, env):
|
||||
g.write("#endif\n")
|
||||
|
||||
g.write("};\n")
|
||||
g.close()
|
||||
|
||||
env.main_sources = []
|
||||
env.add_source_files(env.main_sources, "*.cpp")
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*************************************************************************/
|
||||
/* input_default.h */
|
||||
/* default_controller_mappings.h */
|
||||
/*************************************************************************/
|
||||
/* This file is part of: */
|
||||
/* GODOT ENGINE */
|
||||
|
Loading…
Reference in New Issue
Block a user