Index: Lib/distutils/dist.py =================================================================== --- Lib/distutils/dist.py (révision 66667) +++ Lib/distutils/dist.py (copie de travail) @@ -8,7 +8,7 @@ __revision__ = "$Id$" -import sys, os, string, re +import sys, os, re from types import * from copy import copy @@ -307,7 +307,7 @@ else: print indent + "option dict for '%s' command:" % cmd_name out = pformat(opt_dict) - for line in string.split(out, "\n"): + for line in out.split('\n'): print indent + " " + line # dump_option_dicts () @@ -379,7 +379,7 @@ for opt in options: if opt != '__name__': val = parser.get(section,opt) - opt = string.replace(opt, '-', '_') + opt = opt.replace('-', '_') opt_dict[opt] = (filename, val) # Make the ConfigParser forget everything (so we retain @@ -600,14 +600,15 @@ keywords = self.metadata.keywords if keywords is not None: if type(keywords) is StringType: - keywordlist = string.split(keywords, ',') - self.metadata.keywords = map(string.strip, keywordlist) + self.metadata.keywords = [kw.strip() + for kw in keywords.split(',')] + platforms = self.metadata.platforms if platforms is not None: if type(platforms) is StringType: - platformlist = string.split(platforms, ',') - self.metadata.platforms = map(string.strip, platformlist) + self.metadata.platforms = [kw.strip() + for kw in platformlist.split(',')] def _show_help (self, parser, @@ -696,10 +697,10 @@ opt = translate_longopt(opt) value = getattr(self.metadata, "get_"+opt)() if opt in ['keywords', 'platforms']: - print string.join(value, ',') + print ','.join(value) elif opt in ('classifiers', 'provides', 'requires', 'obsoletes'): - print string.join(value, '\n') + print '\n'.join(value) else: print value any_display_options = 1 @@ -804,9 +805,9 @@ """Return a list of packages from which commands are loaded.""" pkgs = self.command_packages if not isinstance(pkgs, type([])): - pkgs = string.split(pkgs or "", ",") + pkgs = (pkgs or '').split(',') for i in range(len(pkgs)): - pkgs[i] = string.strip(pkgs[i]) + pkgs[i] = pkgs[i].strip() pkgs = filter(None, pkgs) if "distutils.command" not in pkgs: pkgs.insert(0, "distutils.command") @@ -1101,7 +1102,7 @@ long_desc = rfc822_escape( self.get_long_description()) self._write_field(file, 'Description', long_desc) - keywords = string.join( self.get_keywords(), ',') + keywords = ','.join(self.get_keywords()) if keywords: self._write_field(file, 'Keywords', keywords)