diff options
author | Guido van Rossum <guido@python.org> | 2007-04-27 23:53:51 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-04-27 23:53:51 (GMT) |
commit | 572dbf8f1320c0b34b9c786e5c30ba4a4b61b292 (patch) | |
tree | 27763a28b40b577302161008a00539649e2a536d /Lib/distutils/command | |
parent | d4617f24caa1827106f5ca5e74655adf919ea499 (diff) | |
download | cpython-572dbf8f1320c0b34b9c786e5c30ba4a4b61b292.zip cpython-572dbf8f1320c0b34b9c786e5c30ba4a4b61b292.tar.gz cpython-572dbf8f1320c0b34b9c786e5c30ba4a4b61b292.tar.bz2 |
Checkpoint. Manipulated things so that string literals are always
unicode, and a few other compensating changes, e.g. str <- unicode,
chr <- unichr, and repr() of a unicode string no longer starts
with 'u'. Lots of unit tests are broken, but some basic things
work, in particular distutils works so the extensions can be built,
and test_builtin.py works.
Diffstat (limited to 'Lib/distutils/command')
-rw-r--r-- | Lib/distutils/command/build_clib.py | 4 | ||||
-rw-r--r-- | Lib/distutils/command/build_ext.py | 10 | ||||
-rw-r--r-- | Lib/distutils/command/build_py.py | 2 | ||||
-rw-r--r-- | Lib/distutils/command/config.py | 8 | ||||
-rw-r--r-- | Lib/distutils/command/install.py | 2 | ||||
-rw-r--r-- | Lib/distutils/command/install_data.py | 3 |
6 files changed, 14 insertions, 15 deletions
diff --git a/Lib/distutils/command/build_clib.py b/Lib/distutils/command/build_clib.py index 07f5817..5434e86 100644 --- a/Lib/distutils/command/build_clib.py +++ b/Lib/distutils/command/build_clib.py @@ -92,7 +92,7 @@ class build_clib (Command): if self.include_dirs is None: self.include_dirs = self.distribution.include_dirs or [] - if type(self.include_dirs) is StringType: + if isinstance(self.include_dirs, basestring): self.include_dirs = self.include_dirs.split(os.pathsep) # XXX same as for build_ext -- what about 'self.define' and @@ -147,7 +147,7 @@ class build_clib (Command): raise DistutilsSetupError, \ "each element of 'libraries' must a 2-tuple" - if type(lib[0]) is not StringType: + if isinstance(lib[0], basestring) StringType: raise DistutilsSetupError, \ "first element of each tuple in 'libraries' " + \ "must be a string (the library name)" diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index 2832d57..0236a26 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -137,7 +137,7 @@ class build_ext (Command): plat_py_include = sysconfig.get_python_inc(plat_specific=1) if self.include_dirs is None: self.include_dirs = self.distribution.include_dirs or [] - if type(self.include_dirs) is StringType: + if isinstance(self.include_dirs, basestring): self.include_dirs = self.include_dirs.split(os.pathsep) # Put the Python "system" include dir at the end, so that @@ -146,7 +146,7 @@ class build_ext (Command): if plat_py_include != py_include: self.include_dirs.append(plat_py_include) - if type(self.libraries) is StringType: + if isinstance(self.libraries, basestring): self.libraries = [self.libraries] # Life is easier if we're not forever checking for None, so @@ -155,12 +155,12 @@ class build_ext (Command): self.libraries = [] if self.library_dirs is None: self.library_dirs = [] - elif type(self.library_dirs) is StringType: + elif isinstance(self.library_dirs, basestring): self.library_dirs = self.library_dirs.split(os.pathsep) if self.rpath is None: self.rpath = [] - elif type(self.rpath) is StringType: + elif isinstance(self.rpath, basestring): self.rpath = self.rpath.split(os.pathsep) # for extensions under windows use different directories @@ -321,7 +321,7 @@ class build_ext (Command): ("each element of 'ext_modules' option must be an " "Extension instance or 2-tuple") - if not (type(ext_name) is StringType and + if not (isinstance(ext_name, basestring) and extension_name_re.match(ext_name)): raise DistutilsSetupError, \ ("first element of each tuple in 'ext_modules' " diff --git a/Lib/distutils/command/build_py.py b/Lib/distutils/command/build_py.py index 990824b..52534bd 100644 --- a/Lib/distutils/command/build_py.py +++ b/Lib/distutils/command/build_py.py @@ -361,7 +361,7 @@ class build_py (Command): def build_module (self, module, module_file, package): - if type(package) is StringType: + if isinstance(package, basestring): package = package.split('.') elif type(package) not in (ListType, TupleType): raise TypeError, \ diff --git a/Lib/distutils/command/config.py b/Lib/distutils/command/config.py index 3374db9..04cfcde 100644 --- a/Lib/distutils/command/config.py +++ b/Lib/distutils/command/config.py @@ -73,17 +73,17 @@ class config (Command): def finalize_options (self): if self.include_dirs is None: self.include_dirs = self.distribution.include_dirs or [] - elif type(self.include_dirs) is StringType: + elif isinstance(self.include_dirs, basestring): self.include_dirs = self.include_dirs.split(os.pathsep) if self.libraries is None: self.libraries = [] - elif type(self.libraries) is StringType: + elif isinstance(self.libraries, basestring): self.libraries = [self.libraries] if self.library_dirs is None: self.library_dirs = [] - elif type(self.library_dirs) is StringType: + elif isinstance(self.library_dirs, basestring): self.library_dirs = self.library_dirs.split(os.pathsep) @@ -212,7 +212,7 @@ class config (Command): self._check_compiler() (src, out) = self._preprocess(body, headers, include_dirs, lang) - if type(pattern) is StringType: + if isinstance(pattern, basestring): pattern = re.compile(pattern) file = open(out) diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py index c03a90e..cc92e96 100644 --- a/Lib/distutils/command/install.py +++ b/Lib/distutils/command/install.py @@ -463,7 +463,7 @@ class install (Command): self.extra_path = self.distribution.extra_path if self.extra_path is not None: - if type(self.extra_path) is StringType: + if isinstance(self.extra_path, basestring): self.extra_path = self.extra_path.split(',') if len(self.extra_path) == 1: diff --git a/Lib/distutils/command/install_data.py b/Lib/distutils/command/install_data.py index 1069830..a951944 100644 --- a/Lib/distutils/command/install_data.py +++ b/Lib/distutils/command/install_data.py @@ -10,7 +10,6 @@ platform-independent data files.""" __revision__ = "$Id$" import os -from types import StringType from distutils.core import Command from distutils.util import change_root, convert_path @@ -48,7 +47,7 @@ class install_data (Command): def run (self): self.mkpath(self.install_dir) for f in self.data_files: - if type(f) is StringType: + if isinstance(f, basestring): # it's a simple file, so copy it f = convert_path(f) if self.warn_dir: |