From c98c5e895a4e54204f9270bf14eb037d07041aa7 Mon Sep 17 00:00:00 2001 From: Shmuel Israelov Date: Tue, 25 Nov 2025 10:49:05 +0200 Subject: [PATCH 1/2] fix: wrong path on migrated venv --- src/virtualenv/activation/bash/activate.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/virtualenv/activation/bash/activate.sh b/src/virtualenv/activation/bash/activate.sh index b54358e9e..d4116b23f 100644 --- a/src/virtualenv/activation/bash/activate.sh +++ b/src/virtualenv/activation/bash/activate.sh @@ -56,7 +56,15 @@ deactivate () { # unset irrelevant variables deactivate nondestructive -VIRTUAL_ENV=__VIRTUAL_ENV__ +if [ ! -d __VIRTUAL_ENV__ ]; then + echo "Virtual environment directory __VIRTUAL_ENV__ does not exist!" >&2 + CURRENT_PATH=$(realpath "${0}") + CURRENT_DIR=$(dirname "${CURRENT_PATH}") + VIRTUAL_ENV="$(realpath "${CURRENT_DIR}/../")" +else + VIRTUAL_ENV=__VIRTUAL_ENV__ +fi + if ([ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ]) && $(command -v cygpath &> /dev/null) ; then VIRTUAL_ENV=$(cygpath -u "$VIRTUAL_ENV") fi From 0550f55230af17943cf83b976f6f8d72ce29f1c6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 25 Nov 2025 08:51:11 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/virtualenv/activation/bash/activate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/virtualenv/activation/bash/activate.sh b/src/virtualenv/activation/bash/activate.sh index d4116b23f..de2d2422c 100644 --- a/src/virtualenv/activation/bash/activate.sh +++ b/src/virtualenv/activation/bash/activate.sh @@ -61,7 +61,7 @@ if [ ! -d __VIRTUAL_ENV__ ]; then CURRENT_PATH=$(realpath "${0}") CURRENT_DIR=$(dirname "${CURRENT_PATH}") VIRTUAL_ENV="$(realpath "${CURRENT_DIR}/../")" -else +else VIRTUAL_ENV=__VIRTUAL_ENV__ fi