# Use python2 if found, otherwise fallback to python.
function _python
  if which python2
    python2 $argv
  else
    python $argv
  end
end

# Use python2 if found, otherwise fallback to python.
function _python
  if available python2
    python2 $argv
  else
    python $argv
  end
end

Use `available` to test if python2 is available
Use `available` to test if python2 is available

ricobl/plugin-python,oh-my-fish/plugin-python