diff options
Diffstat (limited to 'Lib/distutils/command/build_scripts.py')
-rw-r--r-- | Lib/distutils/command/build_scripts.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/distutils/command/build_scripts.py b/Lib/distutils/command/build_scripts.py index a43a7c3..31be793 100644 --- a/Lib/distutils/command/build_scripts.py +++ b/Lib/distutils/command/build_scripts.py @@ -128,10 +128,9 @@ class build_scripts(Command): "The shebang ({!r}) is not decodable " "from the script encoding ({})" .format(shebang, encoding)) - outf = open(outfile, "wb") - outf.write(shebang) - outf.writelines(f.readlines()) - outf.close() + with open(outfile, "wb") as outf: + outf.write(shebang) + outf.writelines(f.readlines()) if f: f.close() else: |