]> granicus.if.org Git - python/commitdiff
Update distutils so that it triggers no warnings when run under -3.
authorBrett Cannon <bcannon@gmail.com>
Sun, 17 Aug 2008 04:16:04 +0000 (04:16 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sun, 17 Aug 2008 04:16:04 +0000 (04:16 +0000)
Lib/distutils/command/build_ext.py
Lib/distutils/command/build_py.py
Lib/distutils/core.py
Misc/NEWS

index 8cf7888117ccc056d73cc75bdd1193fa7e9ee468..1461409f605727a0ed1b94f8e5346414c99fa76f 100644 (file)
@@ -679,7 +679,7 @@ class build_ext (Command):
         so_ext = get_config_var('SO')
         if os.name == 'nt' and self.debug:
             return apply(os.path.join, ext_path) + '_d' + so_ext
-        return apply(os.path.join, ext_path) + so_ext
+        return os.path.join(*ext_path) + so_ext
 
     def get_export_symbols (self, ext):
         """Return the list of symbols that a shared extension has to
index be6d2c5b4da29ffbb12ea49040308fca258556a1..3bf126732831b4c597f1603728bc9a6f39e1f271 100644 (file)
@@ -169,7 +169,7 @@ class build_py (Command):
                     del path[-1]
                 else:
                     tail.insert(0, pdir)
-                    return apply(os.path.join, tail)
+                    return os.path.join(*tail)
             else:
                 # Oops, got all the way through 'path' without finding a
                 # match in package_dir.  If package_dir defines a directory
@@ -337,7 +337,7 @@ class build_py (Command):
 
     def get_module_outfile (self, build_dir, package, module):
         outfile_path = [build_dir] + list(package) + [module + ".py"]
-        return apply(os.path.join, outfile_path)
+        return os.path.join(*outfile_path)
 
 
     def get_outputs (self, include_bytecode=1):
index de9ce7d7ff3396ff2ac1369e249bfe14d093003d..a0e44ea631634468749f59fecbc573743a285435 100644 (file)
@@ -218,7 +218,8 @@ def run_setup (script_name, script_args=None, stop_after="run"):
             sys.argv[0] = script_name
             if script_args is not None:
                 sys.argv[1:] = script_args
-            execfile(script_name, g, l)
+            with open(script_name, 'r') as file:
+                exec file.read() in g, l
         finally:
             sys.argv = save_argv
             _setup_stop_after = None
index 08ee9f9d252c56048a3748484c6d0350ab1e5822..3f5996952b4999b9b3e07af45eddf37f1eca71d8 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -92,11 +92,11 @@ Library
 
 - Changed code in the following modules/packages to remove warnings raised
   while running under the ``-3`` flag: aifc, asynchat, asyncore, bdb, bsddb,
-  ConfigParser, cookielib, csv, difflib, DocXMLRPCServer, email, filecmp,
-  fileinput, inspect, logging, modulefinder, pdb, pickle, profile, pstats,
-  pydoc, re, rlcompleter, SimpleXMLRPCServer, shelve, socket, subprocess,
-  sqlite3, tarfile, Tkinter, test.test_support, textwrap, threading, tokenize,
-  traceback, urlparse, wsgiref, xml, xmlrpclib.
+  ConfigParser, cookielib, csv, difflib, distutils, DocXMLRPCServer, email,
+  filecmp, fileinput, inspect, logging, modulefinder, pdb, pickle, profile,
+  pstats, pydoc, re, rlcompleter, SimpleXMLRPCServer, shelve, socket,
+  subprocess, sqlite3, tarfile, Tkinter, test.test_support, textwrap,
+  threading, tokenize, traceback, urlparse, wsgiref, xml, xmlrpclib.
 
 - Issue #3039: Fix tarfile.TarFileCompat.writestr() which always
   raised an AttributeError.