Skip to content

Commit 56a2122

Browse files
authored
Merge pull request #11157 from OSGeo/backport-11154-to-release/3.10
[Backport release/3.10] Python bindings: fix compatibility issue with SWIG 4.3.0 and PYTHONWARNINGS=error
2 parents bafbd5a + 0937fb1 commit 56a2122

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.github/workflows/cmake_builds.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ jobs:
218218
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/install-gdal/lib
219219
$GITHUB_WORKSPACE/install-gdal/bin/gdalinfo --version
220220
PYTHONPATH=$GITHUB_WORKSPACE/install-gdal/lib/python3.8/site-packages python3 -c "from osgeo import gdal;print(gdal.VersionInfo(None))"
221+
# Test fix for https://github.com/conda-forge/gdal-feedstock/issues/995
222+
PYTHONWARNINGS="error" PYTHONPATH=$GITHUB_WORKSPACE/install-gdal/lib/python3.8/site-packages python3 -c "from osgeo import gdal"
221223
PYTHONPATH=$GITHUB_WORKSPACE/install-gdal/lib/python3.8/site-packages python3 $GITHUB_WORKSPACE/scripts/check_doc.py
222224
- name: CMake with rpath
223225
run: |

swig/python/modify_cpp_files.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,8 @@ string(REPLACE "if (--interpreter_counter != 0) // another sub-interpreter may s
6060
"/* Even Rouault / GDAL hack for SWIG >= 4.1 related to objects not being freed. See swig/python/modify_cpp_files.cmake for more details */\nif( 1 )"
6161
_CONTENTS "${_CONTENTS}")
6262

63+
# Works around https://github.com/swig/swig/issues/3061
64+
string(REPLACE "# define SWIG_HEAPTYPES" "// Below is disabled because of https://github.com/swig/swig/issues/3061\n// # define SWIG_HEAPTYPES"
65+
_CONTENTS "${_CONTENTS}")
66+
6367
file(WRITE ${FILE} "${_CONTENTS}")

0 commit comments

Comments
 (0)