for dir in "$HOME"/Library/Python/*; do
  if [ -d "$dir/bin" ]; then
    export PATH="$PATH:$dir/bin"
  fi
done

if [ -d "$HOME"/Library/Python ]; then
  find "$HOME"/Library/Python -mindepth 2 -maxdepth 2 -type d -name bin -print0 |
    while IFS= read -r -d '' dir; do
      export PATH="$PATH:$dir"
    done
fi

Fix looping over dirs that don’t exist
shell: Fix looping over dirs that don’t exist

Fails with glob error when the directory doesn’t exist, or it has no
children.
