Imported Upstream version 49.0.1 upstream/49.0.1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 29 Dec 2020 22:06:52 +0000 (07:06 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 29 Dec 2020 22:06:52 +0000 (07:06 +0900)
.bumpversion.cfg
CHANGES.rst
setup.cfg
setuptools/_distutils/spawn.py
setuptools/_distutils/tests/test_spawn.py

index 05ff5f1881e9847dab0d119f61640c0417289f5e..87d756b8bb674dc73c93f5e316c54d2f3b2736b2 100644 (file)
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 49.0.0
+current_version = 49.0.1
 commit = True
 tag = True
 
index bd67931d715c4e16cd64e2cb56c2be922096777a..a38b610b46cf776804187515363d45cd8ef600b5 100644 (file)
@@ -1,3 +1,9 @@
+v49.0.1
+-------
+
+* #2228: Applied fix for pypa/distutils#3, restoring expectation that spawn will raise a DistutilsExecError when attempting to execute a missing file.
+
+
 v49.0.0
 -------
 
index d73241861ece68793179f50f634d239b8a468d39..c9d108ca98a688dc17327111bfcf067ceb995e10 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -16,7 +16,7 @@ formats = zip
 
 [metadata]
 name = setuptools
-version = 49.0.0
+version = 49.0.1
 description = Easily download, build, install, upgrade, and uninstall Python packages
 author = Python Packaging Authority
 author_email = distutils-sig@python.org
index aad277b0ca7767c09f470bf402b2053cfcfcf49c..0d1bd0391e6f1134e4472d7e133d8302d564a7dc 100644 (file)
@@ -71,9 +71,15 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0):
             env = dict(os.environ,
                        MACOSX_DEPLOYMENT_TARGET=cur_target)
 
-    proc = subprocess.Popen(cmd, env=env)
-    proc.wait()
-    exitcode = proc.returncode
+    try:
+        proc = subprocess.Popen(cmd, env=env)
+        proc.wait()
+        exitcode = proc.returncode
+    except OSError as exc:
+        if not DEBUG:
+            cmd = cmd[0]
+        raise DistutilsExecError(
+            "command %r failed: %s" % (cmd, exc.args[-1])) from exc
 
     if exitcode:
         if not DEBUG:
index 919d0ad98f853041c549cdeb449ed224d94d6ef7..704019a1989926953ac70456c80f322c4b52fcbb 100644 (file)
@@ -126,6 +126,11 @@ class SpawnTestCase(support.TempdirManager,
                     rv = find_executable(program)
                     self.assertEqual(rv, filename)
 
+    def test_spawn_missing_exe(self):
+        with self.assertRaises(DistutilsExecError) as ctx:
+            spawn(['does-not-exist'])
+            assert 'command does-no-exist failed' in str(ctx)
+
 
 def test_suite():
     return unittest.makeSuite(SpawnTestCase)