aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonmain.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/mesonmain.py')
-rw-r--r--mesonbuild/mesonmain.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index 65d979b..617704a 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -169,7 +169,8 @@ itself as required.'''
g.generate(intr)
g.run_postconf_scripts()
dumpfile = os.path.join(env.get_scratch_dir(), 'build.dat')
- pickle.dump(b, open(dumpfile, 'wb'))
+ with open(dumpfile, 'wb') as f:
+ pickle.dump(b, f)
# Write this last since we use the existence of this file to check if
# we generated the build file successfully, so we don't want an error
# that pops up during generation, post-conf scripts, etc to cause us to