|
8 | 8 | from importlib import resources
|
9 | 9 |
|
10 | 10 |
|
11 |
| - |
12 | 11 | __all__ = ["version", "bootstrap"]
|
13 | 12 | _PACKAGE_NAMES = ('setuptools', 'pip')
|
14 | 13 | _SETUPTOOLS_VERSION = "56.0.0"
|
@@ -79,8 +78,8 @@ def _get_packages():
|
79 | 78 |
|
80 | 79 |
|
81 | 80 | def _run_pip(args, additional_paths=None):
|
82 |
| - # Run the bootstraping in a subprocess to avoid leaking any state that happens |
83 |
| - # after pip has executed. Particulary, this avoids the case when pip holds onto |
| 81 | + # Run the bootstrapping in a subprocess to avoid leaking any state that happens |
| 82 | + # after pip has executed. Particularly, this avoids the case when pip holds onto |
84 | 83 | # the files in *additional_paths*, preventing us to remove them at the end of the
|
85 | 84 | # invocation.
|
86 | 85 | code = f"""
|
@@ -164,9 +163,9 @@ def _bootstrap(*, root=None, upgrade=False, user=False,
|
164 | 163 | for name, package in _get_packages().items():
|
165 | 164 | if package.wheel_name:
|
166 | 165 | # Use bundled wheel package
|
167 |
| - from ensurepip import _bundled |
168 | 166 | wheel_name = package.wheel_name
|
169 |
| - whl = resources.read_binary(_bundled, wheel_name) |
| 167 | + wheel_path = resources.files("ensurepip") / "_bundled" / wheel_name |
| 168 | + whl = wheel_path.read_bytes() |
170 | 169 | else:
|
171 | 170 | # Use the wheel package directory
|
172 | 171 | with open(package.wheel_path, "rb") as fp:
|
|
0 commit comments