File tree 1 file changed +4
-8
lines changed
1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change 3
3
import sys
4
4
import sysconfig
5
5
import tempfile
6
- from contextlib import nullcontext , suppress
6
+ from contextlib import nullcontext
7
7
from importlib import resources
8
8
from pathlib import Path
9
9
from shutil import copy2
24
24
25
25
def _find_wheel_pkg_dir_pip ():
26
26
if _WHEEL_PKG_DIR is None :
27
- raise LookupError (
28
- 'The compile-time `WHEEL_PKG_DIR` is unset so there is '
29
- 'no place for looking up the wheels.' ,
30
- ) from None
31
-
27
+ return None
32
28
33
29
dist_matching_wheels = _WHEEL_PKG_DIR .glob (f'pip-*.whl' )
34
30
try :
@@ -43,8 +39,8 @@ def _find_wheel_pkg_dir_pip():
43
39
44
40
def _get_pip_whl_path_ctx ():
45
41
# Prefer pip from the wheel package directory, if present.
46
- with suppress ( LookupError ) :
47
- return _find_wheel_pkg_dir_pip ()
42
+ if ( alternative_pip_wheel_path := _find_wheel_pkg_dir_pip ()) is not None :
43
+ return alternative_pip_wheel_path
48
44
49
45
return resources .as_file (
50
46
resources .files ('ensurepip' )
You can’t perform that action at this time.
0 commit comments