Skip to content

Commit

Permalink
fix: dont attempt migrating to active virtualenv
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed Nov 29, 2022
1 parent e37df96 commit 0e59159
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bench/utils/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,15 @@ def migrate_env(python, backup=False):
python = which(python)
pvenv = os.path.join(path, nvenv)

if python.startswith(pvenv):
# The supplied python version is in active virtualenv which we are about to nuke.
click.secho(
"Python version supplied is present in currently sourced virtual environment.\n"
"`deactiviate` the current virtual environment before migrating environments.",
fg="yellow",
)
sys.exit(1)

# Clear Cache before Bench Dies.
try:
config = bench.conf
Expand Down

0 comments on commit 0e59159

Please sign in to comment.