Skip to content

Commit

Permalink
Merge pull request #3287 from greysteil/clear-pythonfinder-cache-afte…
Browse files Browse the repository at this point in the history
…r-python-install

Clear pythonfinder cache after Python install
  • Loading branch information
techalchemy committed Nov 23, 2018
2 parents 3aa2bab + b7c735d commit 5446935
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions news/3287.bugfix.rst
@@ -0,0 +1 @@
Clear pythonfinder cache after Python install
5 changes: 5 additions & 0 deletions pipenv/core.py
Expand Up @@ -455,6 +455,11 @@ def abort():
sp.ok(environments.PIPENV_SPINNER_OK_TEXT.format("Success!"))
# Print the results, in a beautiful blue…
click.echo(crayons.blue(c.out), err=True)
# Clear the pythonfinder caches
from .vendor.pythonfinder import Finder
finder = Finder(system=False, global_search=True)
finder.find_python_version.cache_clear()
finder.find_all_python_versions.cache_clear()
# Find the newly installed Python, hopefully.
version = str(version)
path_to_python = find_a_system_python(version)
Expand Down

0 comments on commit 5446935

Please sign in to comment.