summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPradyun Gedam <pradyunsg@gmail.com>2021-08-15 13:29:29 +0100
committerGitHub <noreply@github.com>2021-08-15 13:29:29 +0100
commit1df8934a97ac77f064e2b858b554d3fb5ce43fae (patch)
treeadd0b8b76a87a452c34a1760329a0622c4283925
parentb538f56788e88330dd3e322419f435645f3cf7a4 (diff)
parentcf7183d8757dd05c36f0d8bccbf385fc195e775e (diff)
downloadpip-1df8934a97ac77f064e2b858b554d3fb5ce43fae.tar.gz
Merge pull request #10292 from jdufresne/six-req-install
-rw-r--r--news/ecb79d5a-46b6-4e7b-8ee8-561c9aac697b.vendor.rst0
-rw-r--r--src/pip/_internal/operations/install/legacy.py8
-rw-r--r--src/pip/_internal/req/req_install.py4
3 files changed, 5 insertions, 7 deletions
diff --git a/news/ecb79d5a-46b6-4e7b-8ee8-561c9aac697b.vendor.rst b/news/ecb79d5a-46b6-4e7b-8ee8-561c9aac697b.vendor.rst
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/news/ecb79d5a-46b6-4e7b-8ee8-561c9aac697b.vendor.rst
diff --git a/src/pip/_internal/operations/install/legacy.py b/src/pip/_internal/operations/install/legacy.py
index b7d4301c3..b7abdd4d0 100644
--- a/src/pip/_internal/operations/install/legacy.py
+++ b/src/pip/_internal/operations/install/legacy.py
@@ -3,7 +3,6 @@
import logging
import os
-import sys
from distutils.util import change_root
from typing import List, Optional, Sequence
@@ -20,8 +19,7 @@ logger = logging.getLogger(__name__)
class LegacyInstallFailure(Exception):
- def __init__(self) -> None:
- self.parent = sys.exc_info()
+ pass
def write_installed_files_from_setuptools_record(
@@ -111,9 +109,9 @@ def install(
# Signal to the caller that we didn't install the new package
return False
- except Exception:
+ except Exception as e:
# Signal to the caller that we didn't install the new package
- raise LegacyInstallFailure
+ raise LegacyInstallFailure from e
# At this point, we have successfully installed the requirement.
diff --git a/src/pip/_internal/req/req_install.py b/src/pip/_internal/req/req_install.py
index 615535f24..add22b552 100644
--- a/src/pip/_internal/req/req_install.py
+++ b/src/pip/_internal/req/req_install.py
@@ -9,7 +9,7 @@ import uuid
import zipfile
from typing import Any, Dict, Iterable, List, Optional, Sequence, Union
-from pip._vendor import pkg_resources, six
+from pip._vendor import pkg_resources
from pip._vendor.packaging.markers import Marker
from pip._vendor.packaging.requirements import Requirement
from pip._vendor.packaging.specifiers import SpecifierSet
@@ -795,7 +795,7 @@ class InstallRequirement:
)
except LegacyInstallFailure as exc:
self.install_succeeded = False
- six.reraise(*exc.parent)
+ raise exc.__cause__
except Exception:
self.install_succeeded = True
raise