Skip to content

Commit 4b0d91a

Browse files
d-goldinvsajip
authored andcommitted
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: pypa/virtualenv@28e85bc
1 parent b4cdb3f commit 4b0d91a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/venv/scripts/common/activate

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ deactivate () {
1818
# be called to get it to forget past commands. Without forgetting
1919
# past commands the $PATH changes we made may not be respected
2020
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
21-
hash -r
21+
hash -r 2> /dev/null
2222
fi
2323

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

0 commit comments

Comments
 (0)