Skip to content

Commit b12bb67

Browse files
committed
vsicurl.py: make it work with a curl version with a rc suffix
1 parent 7899cbe commit b12bb67

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

autotest/gcore/vsicurl.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@ def curl_version():
2626
actual_version = [0, 0, 0]
2727
for build_info_item in gdal.VersionInfo("BUILD_INFO").strip().split("\n"):
2828
if build_info_item.startswith("CURL_VERSION="):
29-
actual_version = [
30-
int(x) for x in build_info_item[len("CURL_VERSION=") :].split(".")
31-
]
29+
curl_version = build_info_item[len("CURL_VERSION=") :]
30+
# Remove potential -rcX postfix.
31+
dashrc_pos = curl_version.find("-rc")
32+
if dashrc_pos > 0:
33+
curl_version = curl_version[0:dashrc_pos]
34+
actual_version = [int(x) for x in curl_version.split(".")]
3235
return actual_version
3336

3437

0 commit comments

Comments
 (0)