diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index 622cb591c42d8..a80bdf436eb88 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -1117,6 +1117,9 @@ python_fix_shebang() { python_export_utf8_locale() { debug-print-function ${FUNCNAME} "${@}" + # If the locale program isn't available, just return. + type locale >/dev/null || return 0 + if [[ $(locale charmap) != UTF-8 ]]; then if [[ -n ${LC_ALL} ]]; then ewarn "LC_ALL is set to a locale with a charmap other than UTF-8."