diff --git a/bin/pyenv-virtualenv b/bin/pyenv-virtualenv index f3b0f1b2..a2a772ce 100755 --- a/bin/pyenv-virtualenv +++ b/bin/pyenv-virtualenv @@ -605,7 +605,13 @@ STATUS=0 mkdir -p "${PYENV_VIRTUALENV_CACHE_PATH}" cd "${PYENV_VIRTUALENV_CACHE_PATH}" if [ -n "${USE_CONDA}" ]; then - pyenv-exec conda create $QUIET $VERBOSE --name "${VIRTUALENV_PATH##*/}" --yes "${VIRTUALENV_OPTIONS[@]}" python || STATUS="$?" + if [ -z "$VIRTUALENV_PYTHON" ]; then + #process substitution doesn't seem to work unless it's directly inserted to the command line + #if we add it to VIRTUALENV_OPTIONS instead, "broken pipe" happens + pyenv-exec conda create $QUIET $VERBOSE --name "${VIRTUALENV_PATH##*/}" --yes "${VIRTUALENV_OPTIONS[@]}" --file <(pyenv-exec conda list python --full-name --export) || STATUS="$?" + else + pyenv-exec conda create $QUIET $VERBOSE --name "${VIRTUALENV_PATH##*/}" --yes "${VIRTUALENV_OPTIONS[@]}" || STATUS="$?" + fi else if [ -n "${USE_M_VENV}" ]; then pyenv-exec "${M_VENV_PYTHON_BIN:-python}" -m venv $QUIET $VERBOSE "${VIRTUALENV_OPTIONS[@]}" "${VIRTUALENV_PATH}" || STATUS="$?" diff --git a/test/conda.bats b/test/conda.bats index 43a7bf68..6e186868 100644 --- a/test/conda.bats +++ b/test/conda.bats @@ -32,8 +32,8 @@ unstub_pyenv() { run pyenv-virtualenv venv assert_success - assert_output </dev/null || {