Skip to content

Commit 3063d27

Browse files
committed
Send warning message to logger as well
1 parent 3722683 commit 3063d27

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

shapefile.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -96,24 +96,26 @@
9696
from urlparse import urlparse, urlunparse
9797

9898
if sys.version_info < (3, 9):
99-
warnings.showwarning(
100-
textwrap.dedent("""\
99+
message = textwrap.dedent("""\
101100
Warning!
102101
103-
The PyShp developers propose to drop support for Pythons 3.8 and earlier, including Python 2.
102+
It is proposed to drop support for Pythons 3.8 and earlier, including Python 2.
104103
Thereafter, Python version support will follow the official Python release
105-
cycle: https://devguide.python.org/versions/. This will make Python 3.9 the earliest
106-
supported version until October 2025.
104+
cycle: https://devguide.python.org/versions/. This will make Python 3.9 the
105+
earliest supported version until October 2025.
107106
108-
The reasoning behind this is available in the following discussion:
107+
For more information, and to send the developers your feedback please
108+
see the following discussion:
109109
https://github.com/GeospatialPython/pyshp/discussions/290
110-
Please post any feedback there.
111110
112111
Many thanks,
113-
"""),
112+
""")
113+
logger.warning(message)
114+
warnings.showwarning(
115+
message,
114116
category=UserWarning,
115117
filename=__name__,
116-
lineno=99,
118+
lineno=115,
117119
)
118120

119121

0 commit comments

Comments
 (0)