Skip to content

Commit 5b7cb4f

Browse files
committed
Add pending deprecation warnings for Python 2.7 and 3.4
This change adds pending deprecation warnings for both Python 2.7 and 3.4. Both of these Python versions have reached end-of-life and no longer receive security updates. Future versions of PyKMIP will drop support for both of these Python versions.
1 parent 43016fe commit 5b7cb4f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

kmip/__init__.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
import os
1717
import re
18+
import sys
19+
import warnings
1820

1921
from kmip.core import enums
2022
from kmip.pie import client
@@ -44,3 +46,22 @@
4446
'objects',
4547
'services'
4648
]
49+
50+
51+
if sys.version_info[:2] == (2, 7):
52+
warnings.warn(
53+
(
54+
"PyKMIP will drop support for Python 2.7 in a future release. "
55+
"Please upgrade to a newer version of Python (3.5+ preferred)."
56+
),
57+
PendingDeprecationWarning
58+
)
59+
60+
if sys.version_info[:2] == (3, 4):
61+
warnings.warn(
62+
(
63+
"PyKMIP will drop support for Python 3.4 in a future release. "
64+
"Please upgrade to a newer version of Python (3.5+ preferred)."
65+
),
66+
PendingDeprecationWarning
67+
)

0 commit comments

Comments
 (0)