From e511c6ce8d5c21f279df0b5c8b74ba2dcda67b21 Mon Sep 17 00:00:00 2001 From: Ezio Melotti Date: Tue, 3 Aug 2010 07:51:50 +0000 Subject: [PATCH] Merged revisions 79191 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r79191 | florent.xicluna | 2010-03-21 13:50:17 +0200 (Sun, 21 Mar 2010) | 3 lines No more deprecation warnings for distutils.sysconfig, following r78666. But when the "dl" module is available, it gives a py3k deprecation warning. ........ --- Lib/distutils/archive_util.py | 2 +- Lib/distutils/command/build_py.py | 4 ++-- Lib/distutils/dir_util.py | 2 +- Lib/distutils/filelist.py | 2 +- Lib/distutils/tests/test_build_ext.py | 5 +++++ Lib/test/test_distutils.py | 10 +++------- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Lib/distutils/archive_util.py b/Lib/distutils/archive_util.py index 251c0df4e9..782d4ef96c 100644 --- a/Lib/distutils/archive_util.py +++ b/Lib/distutils/archive_util.py @@ -160,7 +160,7 @@ def make_archive (base_name, format, func = format_info[0] for (arg,val) in format_info[1]: kwargs[arg] = val - filename = apply(func, (base_name, base_dir), kwargs) + filename = func(base_name, base_dir, **kwargs) try: filename = func(base_name, base_dir, **kwargs) diff --git a/Lib/distutils/command/build_py.py b/Lib/distutils/command/build_py.py index 708ef0f38f..9f8a759a74 100644 --- a/Lib/distutils/command/build_py.py +++ b/Lib/distutils/command/build_py.py @@ -157,7 +157,7 @@ class build_py (Command): if not self.package_dir: if path: - return apply(os.path.join, path) + return os.path.join(*path) else: return '' else: @@ -184,7 +184,7 @@ class build_py (Command): tail.insert(0, pdir) if tail: - return apply(os.path.join, tail) + return os.path.join(*tail) else: return '' diff --git a/Lib/distutils/dir_util.py b/Lib/distutils/dir_util.py index 77f253255f..92f49346f7 100644 --- a/Lib/distutils/dir_util.py +++ b/Lib/distutils/dir_util.py @@ -204,7 +204,7 @@ def remove_tree (directory, verbose=0, dry_run=0): _build_cmdtuple(directory, cmdtuples) for cmd in cmdtuples: try: - apply(cmd[0], (cmd[1],)) + cmd[0](cmd[1]) # remove dir from cache if it's already there abspath = os.path.abspath(cmd[1]) if abspath in _path_created: diff --git a/Lib/distutils/filelist.py b/Lib/distutils/filelist.py index 88b33c7c94..4448d5c5a0 100644 --- a/Lib/distutils/filelist.py +++ b/Lib/distutils/filelist.py @@ -68,7 +68,7 @@ class FileList: sortable_files.sort() self.files = [] for sort_tuple in sortable_files: - self.files.append(apply(os.path.join, sort_tuple)) + self.files.append(os.path.join(*sort_tuple)) # -- Other miscellaneous utility methods --------------------------- diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py index 5ecfe15bff..1ed9d04b99 100644 --- a/Lib/distutils/tests/test_build_ext.py +++ b/Lib/distutils/tests/test_build_ext.py @@ -349,6 +349,11 @@ class BuildExtTestCase(support.TempdirManager, self.assertEquals(wanted, path) def test_setuptools_compat(self): + try: + # on some platforms, it loads the deprecated "dl" module + test_support.import_module('setuptools_build_ext', deprecated=True) + except test_support.TestSkipped: + return from setuptools_build_ext import build_ext as setuptools_build_ext from setuptools_extension import Extension diff --git a/Lib/test/test_distutils.py b/Lib/test/test_distutils.py index bf5a80d9b3..a9cbbb46a0 100644 --- a/Lib/test/test_distutils.py +++ b/Lib/test/test_distutils.py @@ -5,17 +5,13 @@ the test_suite() function there returns a test suite that's ready to be run. """ +from test import test_support import distutils.tests -import test.test_support -import warnings def test_main(): - with warnings.catch_warnings(): - warnings.filterwarnings("ignore", - "distutils.sysconfig.\w+ is deprecated", - DeprecationWarning) - test.test_support.run_unittest(distutils.tests.test_suite()) + test_support.run_unittest(distutils.tests.test_suite()) + test_support.reap_children() if __name__ == "__main__": -- 2.40.0