Skip to content

Commit

Permalink
python-info: avoid setting python_info[version] if python is not on t…
Browse files Browse the repository at this point in the history
…he PATH
  • Loading branch information
belak committed Dec 4, 2017
1 parent b407ba0 commit 64d57ec
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/python/functions/python-info
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ if [[ -n "$CONDA_DEFAULT_ENV" ]]; then
python_info[virtualenv]="$virtualenv_formatted"
fi

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

# }

0 comments on commit 64d57ec

Please sign in to comment.