Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python bindings: __init__.py: remove calls to warnings.simplefilter() #11141

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading