Skip to content

Commit 1df8934

Browse files
authored
Merge pull request #10292 from jdufresne/six-req-install
2 parents b538f56 + cf7183d commit 1df8934

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

news/ecb79d5a-46b6-4e7b-8ee8-561c9aac697b.vendor.rst

Whitespace-only changes.

src/pip/_internal/operations/install/legacy.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import logging
55
import os
6-
import sys
76
from distutils.util import change_root
87
from typing import List, Optional, Sequence
98

@@ -20,8 +19,7 @@
2019

2120

2221
class LegacyInstallFailure(Exception):
23-
def __init__(self) -> None:
24-
self.parent = sys.exc_info()
22+
pass
2523

2624

2725
def write_installed_files_from_setuptools_record(
@@ -111,9 +109,9 @@ def install(
111109
# Signal to the caller that we didn't install the new package
112110
return False
113111

114-
except Exception:
112+
except Exception as e:
115113
# Signal to the caller that we didn't install the new package
116-
raise LegacyInstallFailure
114+
raise LegacyInstallFailure from e
117115

118116
# At this point, we have successfully installed the requirement.
119117

src/pip/_internal/req/req_install.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import zipfile
1010
from typing import Any, Dict, Iterable, List, Optional, Sequence, Union
1111

12-
from pip._vendor import pkg_resources, six
12+
from pip._vendor import pkg_resources
1313
from pip._vendor.packaging.markers import Marker
1414
from pip._vendor.packaging.requirements import Requirement
1515
from pip._vendor.packaging.specifiers import SpecifierSet
@@ -795,7 +795,7 @@ def install(
795795
)
796796
except LegacyInstallFailure as exc:
797797
self.install_succeeded = False
798-
six.reraise(*exc.parent)
798+
raise exc.__cause__
799799
except Exception:
800800
self.install_succeeded = True
801801
raise

0 commit comments

Comments
 (0)