diff options
author | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2016-08-30 02:52:12 -0400 |
---|---|---|
committer | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2016-08-30 04:17:47 -0400 |
commit | 859c5e28df90851838aacc4b9ad49d3630e4992a (patch) | |
tree | 8a2a553a03a11ad32dd25cae94a7939e58a5e381 /ghwt.py | |
parent | aec1e88c21224691edbe9c2fbba712c267eb917d (diff) | |
download | meson-859c5e28df90851838aacc4b9ad49d3630e4992a.zip meson-859c5e28df90851838aacc4b9ad49d3630e4992a.tar.gz meson-859c5e28df90851838aacc4b9ad49d3630e4992a.tar.bz2 |
Use context manager in scripts.
Diffstat (limited to 'ghwt.py')
-rwxr-xr-x | ghwt.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -52,8 +52,8 @@ def unpack(sproj, branch, outdir): return 1 spdir = os.path.split(outdir)[0] ofilename = os.path.join(spdir, config['wrap-file']['source_filename']) - ofile = open(ofilename, 'wb') - ofile.write(us) + with open(ofilename, 'wb') as ofile: + ofile.write(us) if 'lead_directory_missing' in config['wrap-file']: os.mkdir(outdir) shutil.unpack_archive(ofilename, outdir) |