2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-10 09:02:10 +00:00

fix: dont attempt migrating to active virtualenv

This commit is contained in:
Ankush Menat 2022-11-29 12:49:19 +05:30
parent e37df969c1
commit 0e59159e11

View File

@ -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