Skip to content

Commit 11e1ed0

Browse files
[3.11] gh-93858: Prevent error when activating venv in nested fish instances (GH-93931) (GH-98402)
Co-authored-by: Thomas B. Brunner <[email protected]>
1 parent 651a730 commit 11e1ed0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Lib/venv/scripts/posix/activate.fish

+6-3
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ function deactivate -d "Exit virtual environment and return to normal shell env
1313
end
1414

1515
if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
16-
functions -e fish_prompt
1716
set -e _OLD_FISH_PROMPT_OVERRIDE
18-
functions -c _old_fish_prompt fish_prompt
19-
functions -e _old_fish_prompt
17+
# prevents error when using nested fish instances (Issue #93858)
18+
if functions -q _old_fish_prompt
19+
functions -e fish_prompt
20+
functions -c _old_fish_prompt fish_prompt
21+
functions -e _old_fish_prompt
22+
end
2023
end
2124

2225
set -e VIRTUAL_ENV
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Prevent error when activating venv in nested fish instances.

0 commit comments

Comments
 (0)