diff options
author | Thomas B. Brunner <thomasbbrunner@gmail.com> | 2022-06-27 15:26:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-27 15:26:02 (GMT) |
commit | 117217245390ed3e6fe166180f052e022d296921 (patch) | |
tree | b151d9edb9fe0ef71efb334b3907ab74763369ba /Lib/venv | |
parent | e5e51556e45ff70053b8a7f90a07ded966401911 (diff) | |
download | cpython-117217245390ed3e6fe166180f052e022d296921.zip cpython-117217245390ed3e6fe166180f052e022d296921.tar.gz cpython-117217245390ed3e6fe166180f052e022d296921.tar.bz2 |
gh-93858: Prevent error when activating venv in nested fish instances (GH-93931)
Diffstat (limited to 'Lib/venv')
-rw-r--r-- | Lib/venv/scripts/posix/activate.fish | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/venv/scripts/posix/activate.fish b/Lib/venv/scripts/posix/activate.fish index e40a1d7..9aa4446 100644 --- a/Lib/venv/scripts/posix/activate.fish +++ b/Lib/venv/scripts/posix/activate.fish @@ -13,10 +13,13 @@ function deactivate -d "Exit virtual environment and return to normal shell env end if test -n "$_OLD_FISH_PROMPT_OVERRIDE" - functions -e fish_prompt set -e _OLD_FISH_PROMPT_OVERRIDE - functions -c _old_fish_prompt fish_prompt - functions -e _old_fish_prompt + # prevents error when using nested fish instances (Issue #93858) + if functions -q _old_fish_prompt + functions -e fish_prompt + functions -c _old_fish_prompt fish_prompt + functions -e _old_fish_prompt + end end set -e VIRTUAL_ENV |