Skip to content

Commit e9ab7f5

Browse files
committed
cleanup pyenv virtualenv on ERR
also cleanup compatibility paths
1 parent d89d18d commit e9ab7f5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bin/pyenv-virtualenv

+2-1
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,11 @@ for hook in "${before_hooks[@]}"; do eval "$hook"; done
537537

538538
# Plan cleanup on unsuccessful installation.
539539
cleanup() {
540+
[[ -L "${COMPAT_VIRTUALENV_PATH}" ]] && rm "${COMPAT_VIRTUALENV_PATH}"
540541
[ -z "${PREFIX_EXISTS}" ] && rm -rf "$VIRTUALENV_PATH"
541542
}
542543

543-
trap cleanup SIGINT
544+
trap cleanup SIGINT ERR
544545

545546
# Invoke virtualenv and record exit status in $STATUS.
546547
STATUS=0

0 commit comments

Comments
 (0)