summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2001-03-22 03:48:31 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2001-03-22 03:48:31 (GMT)
commitac20f773f3b625121ff5f593fbb9f0934bfb8d8e (patch)
tree9a0b4a3b1214a8796d6784abd95a0127d1c745c9 /Lib
parenta7f225d88af3b7a77b0fd8c0ed6129b46c5af865 (diff)
downloadcpython-ac20f773f3b625121ff5f593fbb9f0934bfb8d8e.zip
cpython-ac20f773f3b625121ff5f593fbb9f0934bfb8d8e.tar.gz
cpython-ac20f773f3b625121ff5f593fbb9f0934bfb8d8e.tar.bz2
Back out conversion to string methods; the Distutils is intended to work
with 1.5.2
Diffstat (limited to 'Lib')
-rw-r--r--Lib/distutils/cmd.py6
-rw-r--r--Lib/distutils/cygwinccompiler.py6
-rw-r--r--Lib/distutils/extension.py4
-rw-r--r--Lib/distutils/version.py10
4 files changed, 13 insertions, 13 deletions
diff --git a/Lib/distutils/cmd.py b/Lib/distutils/cmd.py
index cec4bff..ce44829 100644
--- a/Lib/distutils/cmd.py
+++ b/Lib/distutils/cmd.py
@@ -9,7 +9,7 @@ in the distutils.command package.
__revision__ = "$Id$"
-import sys, os, re
+import sys, os, string, re
from types import *
from distutils.errors import *
from distutils import util, dir_util, file_util, archive_util, dep_util
@@ -161,7 +161,7 @@ class Command:
print indent + header
indent = indent + " "
for (option, _, _) in self.user_options:
- option = option.translate(longopt_xlate)
+ option = string.translate(option, longopt_xlate)
if option[-1] == "=":
option = option[:-1]
value = getattr(self, option)
@@ -421,7 +421,7 @@ class Command:
"""
if exec_msg is None:
exec_msg = "generating %s from %s" % \
- (outfile, ', '.join(infiles))
+ (outfile, string.join(infiles, ', '))
if skip_msg is None:
skip_msg = "skipping %s (inputs unchanged)" % outfile
diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py
index 42318ad..f40d1a2 100644
--- a/Lib/distutils/cygwinccompiler.py
+++ b/Lib/distutils/cygwinccompiler.py
@@ -365,10 +365,10 @@ def check_config_h():
# "config.h" check -- should probably be renamed...
from distutils import sysconfig
- import sys
+ import string,sys
# if sys.version contains GCC then python was compiled with
# GCC, and the config.h file should be OK
- if sys.version.find("GCC") >= 0:
+ if string.find(sys.version,"GCC") >= 0:
return (CONFIG_H_OK, "sys.version mentions 'GCC'")
fn = sysconfig.get_config_h_filename()
@@ -387,7 +387,7 @@ def check_config_h():
else:
# "config.h" contains an "#ifdef __GNUC__" or something similar
- if s.find("__GNUC__") >= 0:
+ if string.find(s,"__GNUC__") >= 0:
return (CONFIG_H_OK, "'%s' mentions '__GNUC__'" % fn)
else:
return (CONFIG_H_NOTOK, "'%s' does not mention '__GNUC__'" % fn)
diff --git a/Lib/distutils/extension.py b/Lib/distutils/extension.py
index f49abad..a63ede2 100644
--- a/Lib/distutils/extension.py
+++ b/Lib/distutils/extension.py
@@ -7,7 +7,7 @@ modules in setup scripts."""
__revision__ = "$Id$"
-import os
+import os, string
from types import *
@@ -168,7 +168,7 @@ def read_setup_file (filename):
elif switch == "-I":
ext.include_dirs.append(value)
elif switch == "-D":
- equals = value.find("=")
+ equals = string.find(value, "=")
if equals == -1: # bare "-DFOO" -- no value
ext.define_macros.append((value, None))
else: # "-DFOO=blah"
diff --git a/Lib/distutils/version.py b/Lib/distutils/version.py
index 2916eb7..9d3d172 100644
--- a/Lib/distutils/version.py
+++ b/Lib/distutils/version.py
@@ -112,12 +112,12 @@ class StrictVersion (Version):
match.group(1, 2, 4, 5, 6)
if patch:
- self.version = tuple(map(int, [major, minor, patch]))
+ self.version = tuple(map(string.atoi, [major, minor, patch]))
else:
- self.version = tuple(map(int, [major, minor]) + [0])
+ self.version = tuple(map(string.atoi, [major, minor]) + [0])
if prerelease:
- self.prerelease = (prerelease[0], int(prerelease_num))
+ self.prerelease = (prerelease[0], string.atoi(prerelease_num))
else:
self.prerelease = None
@@ -125,9 +125,9 @@ class StrictVersion (Version):
def __str__ (self):
if self.version[2] == 0:
- vstring = '.'.join(map(str, self.version[0:2]))
+ vstring = string.join(map(str, self.version[0:2]), '.')
else:
- vstring = '.'.join(map(str, self.version))
+ vstring = string.join(map(str, self.version), '.')
if self.prerelease:
vstring = vstring + self.prerelease[0] + str(self.prerelease[1])