Skip to content

Commit 2472d87

Browse files
committed
Melt the second wheel lookup error into sentinel
1 parent 865c41f commit 2472d87

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Lib/ensurepip/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,16 @@
2424

2525
def _find_wheel_pkg_dir_pip():
2626
if _WHEEL_PKG_DIR is None:
27+
# NOTE: The compile-time `WHEEL_PKG_DIR` is unset so there is no place
28+
# NOTE: for looking up the wheels.
2729
return None
2830

2931
dist_matching_wheels = _WHEEL_PKG_DIR.glob('pip-*.whl')
3032
try:
3133
last_matching_dist_wheel = sorted(dist_matching_wheels)[-1]
32-
except IndexError as index_err:
33-
raise LookupError(
34-
'`WHEEL_PKG_DIR` does not contain any wheel files for `pip`.',
35-
) from index_err
34+
except IndexError:
35+
# NOTE: `WHEEL_PKG_DIR` does not contain any wheel files for `pip`.
36+
return None
3637

3738
return nullcontext(last_matching_dist_wheel)
3839

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy