Skip to content

Commit a30dd1c

Browse files
author
Lenny Verkhovsky
committed
Fixed support python 2 on Fedora 27
I7d16194d6ba1391ca31251d5b50cbb8de033fc38 added wrong behavour on Fedora > 26 and Centos 7 when python3 disabled pip should install packages in /usr/bin Closes-Bug: #1820070 Change-Id: I3a8efbc8eb6e311db9c7347577c5d2047ba523a9
1 parent deadc7c commit a30dd1c

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

inc/python

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,9 @@ function get_python_exec_prefix {
4949
fi
5050
$xtrace
5151

52-
if python3_enabled && [[ "$os_VENDOR" == "CentOS" ]] || \
53-
[[ "$os_VENDOR" == "Fedora" && $os_RELEASE -gt 26 ]]; then
54-
# Default Python 3 install prefix changed to /usr/local in Fedora 27:
55-
# https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
56-
echo "/usr/local/bin"
57-
elif is_fedora || is_suse; then
58-
echo "/usr/bin"
59-
else
60-
echo "/usr/local/bin"
61-
fi
52+
local PYTHON_PATH=/usr/local/bin
53+
( is_fedora && ! python3_enabled ) || is_suse && PYTHON_PATH=/usr/bin
54+
echo $PYTHON_PATH
6255
}
6356

6457
# Wrapper for ``pip install`` that only installs versions of libraries

0 commit comments

Comments
 (0)