Ensure the cqlsh shell script does not behave unexpectedly on Python 3.10+

patch by Bowen Song; revieewed by Ekaterina Dimitrova, Brandon Williams for CASSANDRA-16987
This commit is contained in:
Bowen Song 2021-09-23 11:56:51 +01:00 committed by Ekaterina Dimitrova
parent 80dccde3cd
commit 5f97977dfa
2 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,5 @@
4.0.2
* Prevent CQLSH from failure on Python 3.10 (CASSANDRA-16987)
* Avoid trying to acquire 0 permits from the rate limiter when taking snapshot (CASSANDRA-16872)
* Upgrade Caffeine to 2.5.6 (CASSANDRA-15153)
* Include SASI components to snapshots (CASSANDRA-15134)

View File

@ -60,9 +60,10 @@ get_python_version() {
# test whether a version string matches one of the supported versions for cqlsh
is_supported_version() {
version=$1
# shellcheck disable=SC2072
major_version="${version%.*}"
minor_version="${version#*.}"
# python3.6+ is supported. python2.7 is deprecated but still compatible.
if [ ! "$version" \< "3.6" ] || [ "$version" = "2.7" ]; then
if [ "$major_version" = 3 ] && [ "$minor_version" -ge 6 ] || [ "$version" = "2.7" ]; then
echo "supported"
else
echo "unsupported"