From 09860505ed54d16dd1a0334ef81631ce07f774dc Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Fri, 5 Dec 2025 10:38:11 +0300 Subject: [PATCH] fix --- libexec/pyenv-rehash | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libexec/pyenv-rehash b/libexec/pyenv-rehash index d72a764c..745cfb8e 100755 --- a/libexec/pyenv-rehash +++ b/libexec/pyenv-rehash @@ -35,7 +35,7 @@ release_lock() { } if [ ! -w "$SHIM_PATH" ]; then - echo "pyenv: cannot rehash: $SHIM_PATH isn't writable" + echo "pyenv: cannot rehash: $SHIM_PATH isn't writable" >&2 exit 1 fi @@ -53,18 +53,20 @@ while (( SECONDS <= start + ${PYENV_REHASH_TIMEOUT:-60} )); do # in a way that taxes the usual use case as little as possible. if [[ -z $tested_for_other_write_errors ]]; then ( t="$(mktemp -p "$SHIM_PATH")" && rm "$t" ) && tested_for_other_write_errors=1 || - { echo "pyenv: cannot rehash: $SHIM_PATH isn't writable"; break } + { echo "pyenv: cannot rehash: $SHIM_PATH isnt writable" >&2; break; } fi # POSIX sleep(1) doesn't provide subsecond precision, but many others do sleep 0.1 2>/dev/null || sleep 1 fi done -unset tested_for_other_write_errors if [ -z "${acquired}" ]; then - echo "pyenv: cannot rehash: $PROTOTYPE_SHIM_PATH exists" + if [[ -n $tested_for_other_write_errors ]]; then + echo "pyenv: cannot rehash: $PROTOTYPE_SHIM_PATH exists" >&2 + fi exit 1 fi +unset tested_for_other_write_errors # The prototype shim file is a script that re-execs itself, passing # its filename and any arguments to `pyenv exec`. This file is