diff --git a/CHANGES.txt b/CHANGES.txt index 3e76c71ba1..619c1a94f6 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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) diff --git a/bin/cqlsh b/bin/cqlsh index d13acf785b..a962e1181d 100755 --- a/bin/cqlsh +++ b/bin/cqlsh @@ -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"