Skip to content

Commit ee53c8c

Browse files
committed
vsicurl.py: make it work with a curl version with a rc suffix
1 parent 23cdb2d commit ee53c8c

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
@@ -25,9 +25,12 @@ def curl_version():
2525
actual_version = [0, 0, 0]
2626
for build_info_item in gdal.VersionInfo("BUILD_INFO").strip().split("\n"):
2727
if build_info_item.startswith("CURL_VERSION="):
28-
actual_version = [
29-
int(x) for x in build_info_item[len("CURL_VERSION=") :].split(".")
30-
]
28+
curl_version = build_info_item[len("CURL_VERSION=") :]
29+
# Remove potential -rcX postfix.
30+
dashrc_pos = curl_version.find("-rc")
31+
if dashrc_pos > 0:
32+
curl_version = curl_version[0:dashrc_pos]
33+
actual_version = [int(x) for x in curl_version.split(".")]
3134
return actual_version
3235

3336

0 commit comments

Comments
 (0)