]> granicus.if.org Git - python/commitdiff
Patch #1696. Don't attempt to call None.close() in dry-run mode.
authorGuido van Rossum <guido@python.org>
Wed, 2 Jan 2008 18:59:36 +0000 (18:59 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 2 Jan 2008 18:59:36 +0000 (18:59 +0000)
Lib/distutils/command/build_scripts.py

index bda4480ca59e0b69d2aae172a2d2a153b4b6c673..d26fe94b7ef5badea34f351548a102c14dc89302 100644 (file)
@@ -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':