Warning about Python 2.6 deprecation

This commit is contained in:
Alessio Sergi 2016-03-11 12:26:26 +01:00
parent 2d255b55ab
commit 45820e9183
3 changed files with 15 additions and 1 deletions

7
NEWS
View File

@ -5,6 +5,13 @@ Glances Version 2
Version 2.6
===========
Deprecations:
* Add deprecation warning for Python 2.6.
Python 2.6 support will be dropped in future releases.
Please switch to at least Python 2.7 or 3.3+ as soon as possible.
See http://www.snarky.ca/stop-using-python-2-6 for more information.
Enhancements and new features:
* Add a connector to ElasticSearch (welcome to Kibana dashboard) (issue #311)

View File

@ -53,6 +53,13 @@ if sys.version_info < (2, 6) or (3, 0) <= sys.version_info < (3, 3):
print('Glances requires at least Python 2.6 or 3.3 to run.')
sys.exit(1)
if sys.version_info[:2] == (2, 6):
import warnings
warnings.warn('Python 2.6 support will be dropped. Please switch '
'to at least Python 2.7 or 3.3+ as soon as possible. '
'See http://www.snarky.ca/stop-using-python-2-6 '
'for more information.')
# Check PSutil version
psutil_min_version = (2, 0, 0)
psutil_version = tuple([int(num) for num in __psutil_version.split('.')])

View File

@ -40,7 +40,7 @@ def get_requires():
requires = ['psutil>=2.0.0']
if sys.platform.startswith('win'):
requires += ['colorconsole']
if sys.version_info == (2, 6):
if sys.version_info[:2] == (2, 6):
requires += ['argparse', 'logutils']
return requires