diff options
| author | Bernat Gabor <bgabor8@bloomberg.net> | 2020-01-29 12:11:26 +0000 |
|---|---|---|
| committer | Bernat Gabor <bgabor8@bloomberg.net> | 2020-01-29 12:11:26 +0000 |
| commit | cd308f3987446f545c2e2e59a0d5008bcdeea58e (patch) | |
| tree | 6e3d867c7a6e7a83276dd5082fc2c58b7510e212 | |
| parent | 2e3f6c842eaf328112a89d1e13c0ade6e82b0512 (diff) | |
| download | virtualenv-cd308f3987446f545c2e2e59a0d5008bcdeea58e.tar.gz | |
We should override the executable rather than original executable during our py info cache load
Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
| -rw-r--r-- | src/virtualenv/discovery/cached_py_info.py | 2 | ||||
| -rw-r--r-- | tests/unit/discovery/py_info/test_py_info.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/virtualenv/discovery/cached_py_info.py b/src/virtualenv/discovery/cached_py_info.py index 19db98b..6f8fe57 100644 --- a/src/virtualenv/discovery/cached_py_info.py +++ b/src/virtualenv/discovery/cached_py_info.py @@ -49,7 +49,7 @@ def _get_from_cache(exe, ignore_cache=True): 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 + result.executable = exe return result diff --git a/tests/unit/discovery/py_info/test_py_info.py b/tests/unit/discovery/py_info/test_py_info.py index 22f90d0..9d2994b 100644 --- a/tests/unit/discovery/py_info/test_py_info.py +++ b/tests/unit/discovery/py_info/test_py_info.py @@ -136,5 +136,5 @@ def test_py_info_cached_symlink(mocker, tmp_path): new_exe.symlink_to(sys.executable) new_exe_str = str(new_exe) second_result = PythonInfo.from_exe(new_exe_str) - assert second_result.original_executable == new_exe_str + assert second_result.executable == new_exe_str assert spy.call_count == 1 |
