From 9b1f5a4740f227c78d9f2c4be8dd741992007a3a Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 2 Jan 2008 18:59:36 +0000 Subject: [PATCH] Patch #1696. Don't attempt to call None.close() in dry-run mode. --- Lib/distutils/command/build_scripts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/distutils/command/build_scripts.py b/Lib/distutils/command/build_scripts.py index bda4480ca59..d26fe94b7ef 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':