Browse Source

python-info: avoid setting python_info[version] if python is not on the PATH

master
Kaleb Elwert 7 years ago
parent
commit
07fe0d0e31
  1. 2
      modules/python/functions/python-info

2
modules/python/functions/python-info

@ -32,10 +32,12 @@ if [[ -n "$CONDA_DEFAULT_ENV" ]]; then
python_info[virtualenv]="$virtualenv_formatted" python_info[virtualenv]="$virtualenv_formatted"
fi fi
if (( $+commands[python] )); then
zstyle -s ':prezto:module:python:info:version' format 'version_format' zstyle -s ':prezto:module:python:info:version' format 'version_format'
if [[ -n "$version_format" ]]; then if [[ -n "$version_format" ]]; then
zformat -f version_formatted "$version_format" "v:${$(python3 --version)#Python }" zformat -f version_formatted "$version_format" "v:${$(python3 --version)#Python }"
python_info[version]="$version_formatted" python_info[version]="$version_formatted"
fi fi
fi
# } # }

Loading…
Cancel
Save