Skip to content

Commit

Permalink
Merge pull request #11141 from rouault/fix_11140
Browse files Browse the repository at this point in the history
Python bindings: __init__.py: remove calls to warnings.simplefilter()
  • Loading branch information
rouault authored Oct 28, 2024
2 parents 2c12b7a + 166ee6f commit 0332c83
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 0332c83

Please sign in to comment.