From a9eb9e73def8ca6c469e59f1b008746e368ad4c1 Mon Sep 17 00:00:00 2001 From: Ram Rachum Date: Tue, 16 Jun 2020 13:31:12 +0300 Subject: Fix exception causes all over the codebase --- setuptools/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools/installer.py') diff --git a/setuptools/installer.py b/setuptools/installer.py index 1f183bd9..e5acec27 100644 --- a/setuptools/installer.py +++ b/setuptools/installer.py @@ -127,7 +127,7 @@ def fetch_build_egg(dist, req): try: subprocess.check_call(cmd) except subprocess.CalledProcessError as e: - raise DistutilsError(str(e)) + raise DistutilsError(str(e)) from e wheel = Wheel(glob.glob(os.path.join(tmpdir, '*.whl'))[0]) dist_location = os.path.join(eggs_dir, wheel.egg_name()) wheel.install_as_egg(dist_location) -- cgit v1.2.1 From fb7ab81a3d080422687bad71f9ae9d36eeefbee2 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 16 Aug 2020 00:29:24 -0400 Subject: Remove Python 2 compatibility --- setuptools/installer.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'setuptools/installer.py') diff --git a/setuptools/installer.py b/setuptools/installer.py index e5acec27..e630b874 100644 --- a/setuptools/installer.py +++ b/setuptools/installer.py @@ -2,20 +2,18 @@ import glob import os import subprocess import sys +import tempfile from distutils import log from distutils.errors import DistutilsError import pkg_resources from setuptools.command.easy_install import easy_install -from setuptools.extern import six from setuptools.wheel import Wheel -from .py31compat import TemporaryDirectory - def _fixup_find_links(find_links): """Ensure find-links option end-up being a list of strings.""" - if isinstance(find_links, six.string_types): + if isinstance(find_links, str): return find_links.split() assert isinstance(find_links, (tuple, list)) return find_links @@ -103,7 +101,7 @@ def fetch_build_egg(dist, req): for egg_dist in pkg_resources.find_distributions(eggs_dir): if egg_dist in req and environment.can_add(egg_dist): return egg_dist - with TemporaryDirectory() as tmpdir: + with tempfile.TemporaryDirectory() as tmpdir: cmd = [ sys.executable, '-m', 'pip', '--disable-pip-version-check', -- cgit v1.2.1