diff --git a/Lib/distutils/command/build_scripts.py b/Lib/distutils/command/build_scripts.py index b4810c3eac2..6af363b36dd 100644 --- a/Lib/distutils/command/build_scripts.py +++ b/Lib/distutils/command/build_scripts.py @@ -112,7 +112,8 @@ class build_scripts (Command): if f: f.close() else: - f.close() + if f: + f.close() self.copy_file(script, outfile) if os.name == 'posix':