mirror of https://github.com/apache/cassandra
Update cqlsh python version checking to find python2.7
patch by Jeremiah Jordan; reviewed by Stefania Alborghetti for CASSANDRA-11212
This commit is contained in:
parent
65464492ef
commit
e856d8f81e
11
bin/cqlsh
11
bin/cqlsh
|
|
@ -15,5 +15,12 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
python "`python -c "import os;print(os.path.dirname(os.path.realpath('$0')))"`/cqlsh.py" "$@"
|
||||
# bash code here; finds a suitable python interpreter and execs this file.
|
||||
# prefer unqualified "python" if suitable:
|
||||
python -c 'import sys; sys.exit(not (0x020700b0 < sys.hexversion < 0x03000000))' 2>/dev/null \
|
||||
&& exec python "`python -c "import os;print(os.path.dirname(os.path.realpath('$0')))"`/cqlsh.py" "$@"
|
||||
for pyver in 2.7; do
|
||||
which python$pyver > /dev/null 2>&1 && exec python$pyver "`python$pyver -c "import os;print(os.path.dirname(os.path.realpath('$0')))"`/cqlsh.py" "$@"
|
||||
done
|
||||
echo "No appropriate python interpreter found." >&2
|
||||
exit 1
|
||||
|
|
@ -20,9 +20,9 @@
|
|||
""":"
|
||||
# bash code here; finds a suitable python interpreter and execs this file.
|
||||
# prefer unqualified "python" if suitable:
|
||||
python -c 'import sys; sys.exit(not (0x020500b0 < sys.hexversion < 0x03000000))' 2>/dev/null \
|
||||
python -c 'import sys; sys.exit(not (0x020700b0 < sys.hexversion < 0x03000000))' 2>/dev/null \
|
||||
&& exec python "$0" "$@"
|
||||
for pyver in 2.6 2.7 2.5; do
|
||||
for pyver in 2.7; do
|
||||
which python$pyver > /dev/null 2>&1 && exec python$pyver "$0" "$@"
|
||||
done
|
||||
echo "No appropriate python interpreter found." >&2
|
||||
|
|
|
|||
Loading…
Reference in New Issue