From: Guido van Rossum Date: Wed, 2 Jan 2008 18:59:36 +0000 (+0000) Subject: Patch #1696. Don't attempt to call None.close() in dry-run mode. X-Git-Tag: v2.5.2c1~96 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9b1f5a4740f227c78d9f2c4be8dd741992007a3a;p=python Patch #1696. Don't attempt to call None.close() in dry-run mode. --- diff --git a/Lib/distutils/command/build_scripts.py b/Lib/distutils/command/build_scripts.py index bda4480ca5..d26fe94b7e 100644 --- a/Lib/distutils/command/build_scripts.py +++ b/Lib/distutils/command/build_scripts.py @@ -111,7 +111,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':