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.
........
diff --git a/Lib/distutils/archive_util.py b/Lib/distutils/archive_util.py
index 251c0df..782d4ef 100644
--- a/Lib/distutils/archive_util.py
+++ b/Lib/distutils/archive_util.py
@@ -160,7 +160,7 @@
     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 708ef0f..9f8a759 100644
--- a/Lib/distutils/command/build_py.py
+++ b/Lib/distutils/command/build_py.py
@@ -157,7 +157,7 @@
 
         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 @@
                     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 77f2532..92f4934 100644
--- a/Lib/distutils/dir_util.py
+++ b/Lib/distutils/dir_util.py
@@ -204,7 +204,7 @@
     _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 88b33c7..4448d5c 100644
--- a/Lib/distutils/filelist.py
+++ b/Lib/distutils/filelist.py
@@ -68,7 +68,7 @@
         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 5ecfe15..1ed9d04 100644
--- a/Lib/distutils/tests/test_build_ext.py
+++ b/Lib/distutils/tests/test_build_ext.py
@@ -349,6 +349,11 @@
         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 bf5a80d..a9cbbb4 100644
--- a/Lib/test/test_distutils.py
+++ b/Lib/test/test_distutils.py
@@ -5,17 +5,13 @@
 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__":