Skip to content

Commit bafbd5a

Browse files
authored
Merge pull request #11151 from OSGeo/backport-11141-to-release/3.10
[Backport release/3.10] Python bindings: __init__.py: remove calls to warnings.simplefilter()
2 parents 0dd4abf + 034d7bd commit bafbd5a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

swig/python/osgeo/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ def ver_str(ver):
9393
if fail_on_unsupported_version:
9494
raise Exception(msg)
9595
else:
96-
from warnings import warn, simplefilter
97-
simplefilter('always', DeprecationWarning)
96+
from warnings import warn
9897
warn(msg, DeprecationWarning)
9998
elif this_python_version_will_be_deprecated_in_gdal_version:
10099
msg = 'You are using Python {} with GDAL {}. ' \
@@ -106,6 +105,5 @@ def ver_str(ver):
106105
ver_str(next_version_of_gdal_will_use_python_version),
107106
ver_str(this_python_version_will_be_deprecated_in_gdal_version))
108107

109-
from warnings import warn, simplefilter
110-
simplefilter('always', DeprecationWarning)
108+
from warnings import warn
111109
warn(msg, DeprecationWarning)

0 commit comments

Comments
 (0)