[Python-checkins] r65742 - in python/trunk: Lib/distutils/command/build_ext.py Lib/distutils/command/build_py.py Lib/distutils/core.py Misc/NEWS

brett.cannon python-checkins at python.org
Sun Aug 17 06:16:05 CEST 2008


Author: brett.cannon
Date: Sun Aug 17 06:16:04 2008
New Revision: 65742

Log:
Update distutils so that it triggers no warnings when run under -3.


Modified:
   python/trunk/Lib/distutils/command/build_ext.py
   python/trunk/Lib/distutils/command/build_py.py
   python/trunk/Lib/distutils/core.py
   python/trunk/Misc/NEWS

Modified: python/trunk/Lib/distutils/command/build_ext.py
==============================================================================
--- python/trunk/Lib/distutils/command/build_ext.py	(original)
+++ python/trunk/Lib/distutils/command/build_ext.py	Sun Aug 17 06:16:04 2008
@@ -679,7 +679,7 @@
         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

Modified: python/trunk/Lib/distutils/command/build_py.py
==============================================================================
--- python/trunk/Lib/distutils/command/build_py.py	(original)
+++ python/trunk/Lib/distutils/command/build_py.py	Sun Aug 17 06:16:04 2008
@@ -169,7 +169,7 @@
                     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 @@
 
     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):

Modified: python/trunk/Lib/distutils/core.py
==============================================================================
--- python/trunk/Lib/distutils/core.py	(original)
+++ python/trunk/Lib/distutils/core.py	Sun Aug 17 06:16:04 2008
@@ -218,7 +218,8 @@
             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

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Sun Aug 17 06:16:04 2008
@@ -92,11 +92,11 @@
 
 - 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.


More information about the Python-checkins mailing list