diff options
Diffstat (limited to 'Lib/distutils')
| -rw-r--r-- | Lib/distutils/__init__.py | 2 | ||||
| -rw-r--r-- | Lib/distutils/command/bdist_wininst.py | 6 | ||||
| -rw-r--r-- | Lib/distutils/command/build_scripts.py | 7 | ||||
| -rw-r--r-- | Lib/distutils/tests/test_bdist_rpm.py | 5 | ||||
| -rw-r--r-- | Lib/distutils/tests/test_build_ext.py | 6 |
5 files changed, 17 insertions, 9 deletions
diff --git a/Lib/distutils/__init__.py b/Lib/distutils/__init__.py index 70ab7db..bd7d9dd 100644 --- a/Lib/distutils/__init__.py +++ b/Lib/distutils/__init__.py @@ -15,5 +15,5 @@ __revision__ = "$Id$" # Updated automatically by the Python release process. # #--start constants-- -__version__ = "3.2.1rc1" +__version__ = "3.3a0" #--end constants-- diff --git a/Lib/distutils/command/bdist_wininst.py b/Lib/distutils/command/bdist_wininst.py index b2e2fc6..b886055 100644 --- a/Lib/distutils/command/bdist_wininst.py +++ b/Lib/distutils/command/bdist_wininst.py @@ -263,11 +263,11 @@ class bdist_wininst(Command): cfgdata = cfgdata + b"\0" if self.pre_install_script: # We need to normalize newlines, so we open in text mode and - # convert back to bytes. "latin1" simply avoids any possible + # convert back to bytes. "latin-1" simply avoids any possible # failures. with open(self.pre_install_script, "r", - encoding="latin1") as script: - script_data = script.read().encode("latin1") + encoding="latin-1") as script: + script_data = script.read().encode("latin-1") cfgdata = cfgdata + script_data + b"\n\0" else: # empty pre-install script diff --git a/Lib/distutils/command/build_scripts.py b/Lib/distutils/command/build_scripts.py index a43a7c3..31be793 100644 --- a/Lib/distutils/command/build_scripts.py +++ b/Lib/distutils/command/build_scripts.py @@ -128,10 +128,9 @@ class build_scripts(Command): "The shebang ({!r}) is not decodable " "from the script encoding ({})" .format(shebang, encoding)) - outf = open(outfile, "wb") - outf.write(shebang) - outf.writelines(f.readlines()) - outf.close() + with open(outfile, "wb") as outf: + outf.write(shebang) + outf.writelines(f.readlines()) if f: f.close() else: diff --git a/Lib/distutils/tests/test_bdist_rpm.py b/Lib/distutils/tests/test_bdist_rpm.py index 804fb13..030933f 100644 --- a/Lib/distutils/tests/test_bdist_rpm.py +++ b/Lib/distutils/tests/test_bdist_rpm.py @@ -28,6 +28,11 @@ class BuildRpmTestCase(support.TempdirManager, unittest.TestCase): def setUp(self): + try: + sys.executable.encode("UTF-8") + except UnicodeEncodeError: + raise unittest.SkipTest("sys.executable is not encodable to UTF-8") + super(BuildRpmTestCase, self).setUp() self.old_location = os.getcwd() self.old_sys_argv = sys.argv, sys.argv[:] diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py index 0aa99ba..a5b9700 100644 --- a/Lib/distutils/tests/test_build_ext.py +++ b/Lib/distutils/tests/test_build_ext.py @@ -35,7 +35,9 @@ class BuildExtTestCase(TempdirManager, self.tmp_dir = self.mkdtemp() self.sys_path = sys.path, sys.path[:] sys.path.append(self.tmp_dir) - shutil.copy(_get_source_filename(), self.tmp_dir) + filename = _get_source_filename() + if os.path.exists(filename): + shutil.copy(filename, self.tmp_dir) if sys.version > "2.6": import site self.old_user_base = site.USER_BASE @@ -65,6 +67,8 @@ class BuildExtTestCase(TempdirManager, def test_build_ext(self): global ALREADY_TESTED xx_c = os.path.join(self.tmp_dir, 'xxmodule.c') + if not os.path.exists(xx_c): + return xx_ext = Extension('xx', [xx_c]) dist = Distribution({'name': 'xx', 'ext_modules': [xx_ext]}) dist.package_dir = self.tmp_dir |
