From 117217245390ed3e6fe166180f052e022d296921 Mon Sep 17 00:00:00 2001 From: "Thomas B. Brunner" Date: Mon, 27 Jun 2022 17:26:02 +0200 Subject: gh-93858: Prevent error when activating venv in nested fish instances (GH-93931) --- Lib/venv/scripts/posix/activate.fish | 9 ++++++--- .../next/Library/2022-06-17-12-02-30.gh-issue-93858.R49ARc.rst | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2022-06-17-12-02-30.gh-issue-93858.R49ARc.rst 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 diff --git a/Misc/NEWS.d/next/Library/2022-06-17-12-02-30.gh-issue-93858.R49ARc.rst b/Misc/NEWS.d/next/Library/2022-06-17-12-02-30.gh-issue-93858.R49ARc.rst new file mode 100644 index 0000000..508ba62 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-06-17-12-02-30.gh-issue-93858.R49ARc.rst @@ -0,0 +1 @@ +Prevent error when activating venv in nested fish instances. -- cgit v0.12