Skip to content

Commit

Permalink
swig/python/setup.py.in: fix exception when building a RC git tag
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jan 7, 2025
1 parent 2116577 commit 6201497
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion swig/python/setup.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,11 @@ class gdal_ext(build_ext):
global include_dirs, library_dirs

try:
library_version = self.get_gdal_config("version").replace("dev", "")
library_version = self.get_gdal_config("version")
for suffix in ("dev", "beta", "RC"):
pos = library_version.find(suffix)
if pos > 0:
library_version = library_version[0:pos]
library_version_num = [int(x) for x in library_version.split('.')]
gdal_python_version = [int(x) for x in version.split('.')]
if library_version_num < gdal_python_version:
Expand Down

0 comments on commit 6201497

Please sign in to comment.