@@ -32,9 +32,8 @@ class PythonInfo: # noqa: PLR0904
32
32
"""Contains information for a Python interpreter."""
33
33
34
34
def __init__ (self ) -> None : # noqa: PLR0915
35
- def real_path (v ):
36
- # unroll relative elements from path (e.g. ..) and ensure symbolic links are resolved
37
- return None if v is None else os .path .realpath (v )
35
+ def abs_path (v ):
36
+ return None if v is None else os .path .abspath (v ) # unroll relative elements from path (e.g. ..)
38
37
39
38
# qualifies the python
40
39
self .platform = sys .platform
@@ -54,16 +53,16 @@ def real_path(v):
54
53
self .os = os .name
55
54
56
55
# information about the prefix - determines python home
57
- self .prefix = real_path (getattr (sys , "prefix" , None )) # prefix we think
58
- self .base_prefix = real_path (getattr (sys , "base_prefix" , None )) # venv
59
- self .real_prefix = real_path (getattr (sys , "real_prefix" , None )) # old virtualenv
56
+ self .prefix = abs_path (getattr (sys , "prefix" , None )) # prefix we think
57
+ self .base_prefix = abs_path (getattr (sys , "base_prefix" , None )) # venv
58
+ self .real_prefix = abs_path (getattr (sys , "real_prefix" , None )) # old virtualenv
60
59
61
60
# information about the exec prefix - dynamic stdlib modules
62
- self .base_exec_prefix = real_path (getattr (sys , "base_exec_prefix" , None ))
63
- self .exec_prefix = real_path (getattr (sys , "exec_prefix" , None ))
61
+ self .base_exec_prefix = abs_path (getattr (sys , "base_exec_prefix" , None ))
62
+ self .exec_prefix = abs_path (getattr (sys , "exec_prefix" , None ))
64
63
65
- self .executable = real_path (sys .executable ) # the executable we were invoked via
66
- self .original_executable = real_path (self .executable ) # the executable as known by the interpreter
64
+ self .executable = abs_path (sys .executable ) # the executable we were invoked via
65
+ self .original_executable = abs_path (self .executable ) # the executable as known by the interpreter
67
66
self .system_executable = self ._fast_get_system_executable () # the executable we are based of (if available)
68
67
69
68
try :
0 commit comments