Correct an issue after commit eaa8e39771 concerning the QickLook display

This commit is contained in:
nicolargo 2015-05-02 12:36:48 +02:00
parent eaa8e39771
commit 3992ff07ad

View File

@ -28,6 +28,7 @@ __license__ = 'LGPL'
import platform
import signal
import sys
import locale
# Import psutil
try:
@ -41,6 +42,17 @@ except ImportError:
from glances.core.glances_logging import logger
from glances.core.glances_main import GlancesMain
# Setup translations
try:
locale.setlocale(locale.LC_ALL, '')
except locale.Error:
# Issue #517
# Setting LC_ALL to '' should not generate an error unless LC_ALL is not
# defined in the user environment, which can be the case when used via SSH.
# So simply skip this error, as python will use the C locale by default.
logger.warning("No locale LC_ALL variable found. Use the default C locale.")
pass
# Check Python version
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.')