venv: Suppress warning message when bash hashing is disabled. (GH-17966)

When using python's built-in venv activaton script
warnings are printed when hashing is disabled in
bash or zsh, like;

`bash: hash: hashing disabled`

This output is not really useful to the end-user and has
been disabled in `virtualenv` for long.

This commit is based on:
28e85bcd80
This commit is contained in:
Dima 2020-01-14 21:47:59 +01:00 committed by Vinay Sajip
parent b4cdb3f60e
commit 4b0d91aab4
1 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ deactivate () {
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r
hash -r 2> /dev/null
fi
if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
@ -62,5 +62,5 @@ fi
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r
hash -r 2> /dev/null
fi