common: Replace the use of python2 with python3

We want to move to python3 eventually so update the script snippet. We
can be sure that python3 is installed, because portage already
requires it.
This commit is contained in:
Krzesimir Nowak 2021-08-13 18:17:52 +02:00
parent bd5c0c6a0e
commit df63498a91

View File

@ -843,8 +843,8 @@ reinterpret_path_for_chroot() {
# Get the relative path between two locations. Handy for printing paths to # Get the relative path between two locations. Handy for printing paths to
# the user that will usually make sense both inside and outside the chroot. # the user that will usually make sense both inside and outside the chroot.
relpath() { relpath() {
local py='import sys, os; print os.path.relpath(sys.argv[1], sys.argv[2])' local py='import sys, os; print(os.path.relpath(sys.argv[1], sys.argv[2]))'
python2 -c "${py}" "${1}" "${2:-.}" python3 -c "${py}" "${1}" "${2:-.}"
} }
enable_strict_sudo() { enable_strict_sudo() {