summaryrefslogtreecommitdiff
path: root/src/virtualenv/discovery
diff options
context:
space:
mode:
authorBernát Gábor <bgabor8@bloomberg.net>2020-01-28 16:50:07 +0000
committerGitHub <noreply@github.com>2020-01-28 16:50:07 +0000
commit2e3f6c842eaf328112a89d1e13c0ade6e82b0512 (patch)
tree7c72ae89e0699cb240097e9008df93fd47690cb7 /src/virtualenv/discovery
parentd9c859cb0cb5e7e90011a488a159a907f1e15dab (diff)
downloadvirtualenv-2e3f6c842eaf328112a89d1e13c0ade6e82b0512.tar.gz
Cached python information load should update original executable (#1513)
* Cached python information load should update original executable Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net> * add some tests to validate solution Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
Diffstat (limited to 'src/virtualenv/discovery')
-rw-r--r--src/virtualenv/discovery/cached_py_info.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/virtualenv/discovery/cached_py_info.py b/src/virtualenv/discovery/cached_py_info.py
index baa0ded..19db98b 100644
--- a/src/virtualenv/discovery/cached_py_info.py
+++ b/src/virtualenv/discovery/cached_py_info.py
@@ -47,6 +47,9 @@ def _get_from_cache(exe, ignore_cache=True):
else: # then check the persisted cache
py_info = _get_via_file_cache(resolved_resolved_path, exe)
result = _CACHE[resolved_resolved_path] = py_info
+ # independent if it was from the file or in-memory cache fix the original executable location
+ if isinstance(result, PythonInfo):
+ result.original_executable = exe
return result