diff options
author | Guido van Rossum <guido@python.org> | 2007-10-16 18:12:55 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-10-16 18:12:55 (GMT) |
commit | 3172c5d263eeffff1e89d03d79be3ccc1d60fbde (patch) | |
tree | a35e103b36b684c4682ded57236199d6a0ecee4b /Lib/distutils/command | |
parent | 60d241f135f10312f5a638846659d7e471f6cac9 (diff) | |
download | cpython-3172c5d263eeffff1e89d03d79be3ccc1d60fbde.zip cpython-3172c5d263eeffff1e89d03d79be3ccc1d60fbde.tar.gz cpython-3172c5d263eeffff1e89d03d79be3ccc1d60fbde.tar.bz2 |
Patch# 1258 by Christian Heimes: kill basestring.
I like this because it makes the code shorter! :-)
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 | 2 |
6 files changed, 14 insertions, 14 deletions
diff --git a/Lib/distutils/command/build_clib.py b/Lib/distutils/command/build_clib.py index 5f95207..34f4983 100644 --- a/Lib/distutils/command/build_clib.py +++ b/Lib/distutils/command/build_clib.py @@ -86,7 +86,7 @@ class build_clib(Command): if self.include_dirs is None: self.include_dirs = self.distribution.include_dirs or [] - if isinstance(self.include_dirs, basestring): + if isinstance(self.include_dirs, str): self.include_dirs = self.include_dirs.split(os.pathsep) # XXX same as for build_ext -- what about 'self.define' and @@ -134,7 +134,7 @@ class build_clib(Command): raise DistutilsSetupError( "each element of 'libraries' must a 2-tuple") - if isinstance(lib[0], basestring): + if isinstance(lib[0], str): 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 a439c49..ddf8f72 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -133,7 +133,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 isinstance(self.include_dirs, basestring): + if isinstance(self.include_dirs, str): self.include_dirs = self.include_dirs.split(os.pathsep) # Put the Python "system" include dir at the end, so that @@ -142,7 +142,7 @@ class build_ext(Command): if plat_py_include != py_include: self.include_dirs.append(plat_py_include) - if isinstance(self.libraries, basestring): + if isinstance(self.libraries, str): self.libraries = [self.libraries] # Life is easier if we're not forever checking for None, so @@ -151,12 +151,12 @@ class build_ext(Command): self.libraries = [] if self.library_dirs is None: self.library_dirs = [] - elif isinstance(self.library_dirs, basestring): + elif isinstance(self.library_dirs, str): self.library_dirs = self.library_dirs.split(os.pathsep) if self.rpath is None: self.rpath = [] - elif isinstance(self.rpath, basestring): + elif isinstance(self.rpath, str): self.rpath = self.rpath.split(os.pathsep) # for extensions under windows use different directories @@ -309,7 +309,7 @@ class build_ext(Command): "each element of 'ext_modules' option must be an " "Extension instance or 2-tuple") - if not (isinstance(ext_name, basestring) and + if not (isinstance(ext_name, str) 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 454424f..63ced4b 100644 --- a/Lib/distutils/command/build_py.py +++ b/Lib/distutils/command/build_py.py @@ -325,7 +325,7 @@ class build_py (Command): return outputs def build_module(self, module, module_file, package): - if isinstance(package, basestring): + if isinstance(package, str): package = package.split('.') elif not isinstance(package, (list, tuple)): raise TypeError( diff --git a/Lib/distutils/command/config.py b/Lib/distutils/command/config.py index a601234..34f9188 100644 --- a/Lib/distutils/command/config.py +++ b/Lib/distutils/command/config.py @@ -69,17 +69,17 @@ class config(Command): def finalize_options(self): if self.include_dirs is None: self.include_dirs = self.distribution.include_dirs or [] - elif isinstance(self.include_dirs, basestring): + elif isinstance(self.include_dirs, str): self.include_dirs = self.include_dirs.split(os.pathsep) if self.libraries is None: self.libraries = [] - elif isinstance(self.libraries, basestring): + elif isinstance(self.libraries, str): self.libraries = [self.libraries] if self.library_dirs is None: self.library_dirs = [] - elif isinstance(self.library_dirs, basestring): + elif isinstance(self.library_dirs, str): self.library_dirs = self.library_dirs.split(os.pathsep) def run(self): @@ -204,7 +204,7 @@ class config(Command): self._check_compiler() (src, out) = self._preprocess(body, headers, include_dirs, lang) - if isinstance(pattern, basestring): + if isinstance(pattern, str): pattern = re.compile(pattern) file = open(out) diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py index f1ebcbf..b768663 100644 --- a/Lib/distutils/command/install.py +++ b/Lib/distutils/command/install.py @@ -449,7 +449,7 @@ class install (Command): self.extra_path = self.distribution.extra_path if self.extra_path is not None: - if isinstance(self.extra_path, basestring): + if isinstance(self.extra_path, str): 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 2fbac63..06a70b4 100644 --- a/Lib/distutils/command/install_data.py +++ b/Lib/distutils/command/install_data.py @@ -45,7 +45,7 @@ class install_data(Command): def run(self): self.mkpath(self.install_dir) for f in self.data_files: - if isinstance(f, basestring): + if isinstance(f, str): # it's a simple file, so copy it f = convert_path(f) if self.warn_dir: |