Adding pending deprecation warning for Python2.6

This change add a simple warning that is triggered whenever Python
2.6 is used with PyKMIP. It simply advises the user to use a newer
version of Python. For now, Python 2.6 can still be used with
PyKMIP.
This commit is contained in:
Peter 2016-01-14 10:21:17 -05:00
parent 44f5b1978b
commit b7add2179d
1 changed files with 9 additions and 0 deletions

View File

@ -17,6 +17,7 @@ import logging.config
import os
import re
import sys
import warnings
# Dynamically set __version__
version_path = os.path.join(os.path.dirname(
@ -63,3 +64,11 @@ else:
logging.basicConfig()
__all__ = ['core', 'demos', 'services']
if sys.version_info[:2] == (2, 6):
warnings.simplefilter("always")
warnings.warn(
("Please use a newer version of Python (2.7.9+ preferred). PyKMIP "
"support for Python 2.6 will be deprecated in the future."),
PendingDeprecationWarning)
warnings.simplefilter("default")