FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update distutils so that it triggers no warnings when run under -3. · pylee/python@3c2cfcf · GitHub

/ python Public
forked from glix/python

Commit 3c2cfcf

Browse files
brett.cannon
committed
Update distutils so that it triggers no warnings when run under -3.
git-svn-id: http://svn.python.org/projects/python/trunk@65742 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 84d9781 commit 3c2cfcf

4 files changed

Lines changed: 10 additions & 9 deletions

File tree

‎Lib/distutils/command/build_ext.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ def get_ext_filename (self, ext_name):
679679
so_ext = get_config_var('SO')
680680
if os.name == 'nt' and self.debug:
681681
return apply(os.path.join, ext_path) + '_d' + so_ext
682-
return apply(os.path.join, ext_path) + so_ext
682+
return os.path.join(*ext_path) + so_ext
683683

684684
def get_export_symbols (self, ext):
685685
"""Return the list of symbols that a shared extension has to

‎Lib/distutils/command/build_py.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def get_package_dir (self, package):
169169
del path[-1]
170170
else:
171171
tail.insert(0, pdir)
172-
return apply(os.path.join, tail)
172+
return os.path.join(*tail)
173173
else:
174174
# Oops, got all the way through 'path' without finding a
175175
# match in package_dir. If package_dir defines a directory
@@ -337,7 +337,7 @@ def get_source_files (self):
337337

338338
def get_module_outfile (self, build_dir, package, module):
339339
outfile_path = [build_dir] + list(package) + [module + ".py"]
340-
return apply(os.path.join, outfile_path)
340+
return os.path.join(*outfile_path)
341341

342342

343343
def get_outputs (self, include_bytecode=1):

‎Lib/distutils/core.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ def run_setup (script_name, script_args=None, stop_after="run"):
218218
sys.argv[0] = script_name
219219
if script_args is not None:
220220
sys.argv[1:] = script_args
221-
execfile(script_name, g, l)
221+
with open(script_name, 'r') as file:
222+
exec file.read() in g, l
222223
finally:
223224
sys.argv = save_argv
224225
_setup_stop_after = None

‎Misc/NEWS‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ Library
9292

9393
- Changed code in the following modules/packages to remove warnings raised
9494
while running under the ``-3`` flag: aifc, asynchat, asyncore, bdb, bsddb,
95-
ConfigParser, cookielib, csv, difflib, DocXMLRPCServer, email, filecmp,
96-
fileinput, inspect, logging, modulefinder, pdb, pickle, profile, pstats,
97-
pydoc, re, rlcompleter, SimpleXMLRPCServer, shelve, socket, subprocess,
98-
sqlite3, tarfile, Tkinter, test.test_support, textwrap, threading, tokenize,
99-
traceback, urlparse, wsgiref, xml, xmlrpclib.
95+
ConfigParser, cookielib, csv, difflib, distutils, DocXMLRPCServer, email,
96+
filecmp, fileinput, inspect, logging, modulefinder, pdb, pickle, profile,
97+
pstats, pydoc, re, rlcompleter, SimpleXMLRPCServer, shelve, socket,
98+
subprocess, sqlite3, tarfile, Tkinter, test.test_support, textwrap,
99+
threading, tokenize, traceback, urlparse, wsgiref, xml, xmlrpclib.
100100

101101
- Issue #3039: Fix tarfile.TarFileCompat.writestr() which always
102102
raised an AttributeError.

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL