Skip to content

Commit

Permalink
Merge pull request #11151 from OSGeo/backport-11141-to-release/3.10
Browse files Browse the repository at this point in the history
[Backport release/3.10] Python bindings: __init__.py: remove calls to warnings.simplefilter()
  • Loading branch information
rouault authored Oct 28, 2024
2 parents 0dd4abf + 034d7bd commit bafbd5a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions swig/python/osgeo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ def ver_str(ver):
if fail_on_unsupported_version:
raise Exception(msg)
else:
from warnings import warn, simplefilter
simplefilter('always', DeprecationWarning)
from warnings import warn
warn(msg, DeprecationWarning)
elif this_python_version_will_be_deprecated_in_gdal_version:
msg = 'You are using Python {} with GDAL {}. ' \
Expand All @@ -106,6 +105,5 @@ def ver_str(ver):
ver_str(next_version_of_gdal_will_use_python_version),
ver_str(this_python_version_will_be_deprecated_in_gdal_version))

from warnings import warn, simplefilter
simplefilter('always', DeprecationWarning)
from warnings import warn
warn(msg, DeprecationWarning)

0 comments on commit bafbd5a

Please sign in to comment.