[Python-checkins] distutils2: Improve compatibility with pep8 for file config.py

tarek.ziade python-checkins at python.org
Wed Feb 16 22:23:58 CET 2011


tarek.ziade pushed a82aff76a5c9 to distutils2:

http://hg.python.org/distutils2/rev/a82aff76a5c9
changeset:   1071:a82aff76a5c9
user:        FELD Boris <lothiraldan at gmail.com>
date:        Mon Jan 31 17:35:03 2011 +0100
summary:
  Improve compatibility with pep8 for file config.py

files:
  distutils2/config.py

diff --git a/distutils2/config.py b/distutils2/config.py
--- a/distutils2/config.py
+++ b/distutils2/config.py
@@ -4,9 +4,7 @@
 """
 import os.path
 import os
-import re
 import sys
-import re
 from ConfigParser import RawConfigParser
 from shlex import split
 
@@ -138,11 +136,12 @@
                     # concatenate each files
                     value = ''
                     for filename in filenames:
-                        f = open(filename)    # will raise if file not found
+                        # will raise if file not found
+                        description_file = open(filename)
                         try:
-                            value += f.read().strip() + '\n'
+                            value += description_file.read().strip() + '\n'
                         finally:
-                            f.close()
+                            description_file.close()
                         # add filename as a required file
                         if filename not in metadata.requires_files:
                             metadata.requires_files.append(filename)
@@ -203,8 +202,8 @@
                     destination = None
                 resources.append((prefix, suffix, destination))
                 
-            dir = os.path.dirname(os.path.join(os.getcwd(), cfg_filename))
-            data_files = resources_dests(dir, resources)
+            directory = os.path.dirname(os.path.join(os.getcwd(), cfg_filename))
+            data_files = resources_dests(directory, resources)
             self.dist.data_files = data_files
                 
         ext_modules = self.dist.ext_modules

--
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list