summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2008-08-17 04:16:04 (GMT)
committerBrett Cannon <bcannon@gmail.com>2008-08-17 04:16:04 (GMT)
commit047e4a915d899b31dcb49fd820914df6a9991870 (patch)
treee9d90462ffbe4d527fbbdb908eda52b4213578ab
parent94f243aa41286fa6f3733c21d7936222e7f6c251 (diff)
downloadcpython-047e4a915d899b31dcb49fd820914df6a9991870.zip
cpython-047e4a915d899b31dcb49fd820914df6a9991870.tar.gz
cpython-047e4a915d899b31dcb49fd820914df6a9991870.tar.bz2
Update distutils so that it triggers no warnings when run under -3.
-rw-r--r--Lib/distutils/command/build_ext.py2
-rw-r--r--Lib/distutils/command/build_py.py4
-rw-r--r--Lib/distutils/core.py3
-rw-r--r--Misc/NEWS10
4 files changed, 10 insertions, 9 deletions
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py
index 8cf7888..1461409 100644
--- a/Lib/distutils/command/build_ext.py
+++ b/Lib/distutils/command/build_ext.py
@@ -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
diff --git a/Lib/distutils/command/build_py.py b/Lib/distutils/command/build_py.py
index be6d2c5..3bf1267 100644
--- a/Lib/distutils/command/build_py.py
+++ b/Lib/distutils/command/build_py.py
@@ -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):
diff --git a/Lib/distutils/core.py b/Lib/distutils/core.py
index de9ce7d..a0e44ea 100644
--- a/Lib/distutils/core.py
+++ b/Lib/distutils/core.py
@@ -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
diff --git a/Misc/NEWS b/Misc/NEWS
index 08ee9f9..3f59969 100644
--- 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.