Skip to content

Commit 8500df6

Browse files
Remove unnecessary special cases for bash/zsh (#2086)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 3f41067 commit 8500df6

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

src/virtualenv/activation/bash/activate.sh

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@ deactivate () {
2323
unset _OLD_VIRTUAL_PYTHONHOME
2424
fi
2525

26-
# This should detect bash and zsh, which have a hash command that must
27-
# be called to get it to forget past commands. Without forgetting
28-
# past commands the $PATH changes we made may not be respected
29-
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
30-
hash -r 2>/dev/null
31-
fi
26+
# The hash command must be called to get it to forget past
27+
# commands. Without forgetting past commands the $PATH changes
28+
# we made may not be respected
29+
hash -r 2>/dev/null
3230

3331
if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then
3432
PS1="$_OLD_VIRTUAL_PS1"
@@ -79,9 +77,7 @@ pydoc () {
7977
python -m pydoc "$@"
8078
}
8179

82-
# This should detect bash and zsh, which have a hash command that must
83-
# be called to get it to forget past commands. Without forgetting
84-
# past commands the $PATH changes we made may not be respected
85-
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
86-
hash -r 2>/dev/null
87-
fi
80+
# The hash command must be called to get it to forget past
81+
# commands. Without forgetting past commands the $PATH changes
82+
# we made may not be respected
83+
hash -r 2>/dev/null

0 commit comments

Comments
 (0)