From 210d1692fcfb8be42757395387d04ce4711c9e6d Mon Sep 17 00:00:00 2001 From: Alessio Sergi Date: Wed, 23 Apr 2014 20:04:15 +0200 Subject: [PATCH] Fix running Glances on non-Linux OSes --- glances/core/glances_config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/glances/core/glances_config.py b/glances/core/glances_config.py index 4ad1bbc0..0e57b995 100644 --- a/glances/core/glances_config.py +++ b/glances/core/glances_config.py @@ -19,6 +19,7 @@ # Import system libs import os +import sys try: from configparser import RawConfigParser from configparser import NoOptionError @@ -29,7 +30,10 @@ except ImportError: # Python 2 # Import Glances lib from glances.core.glances_globals import ( __appname__, + is_BSD, is_Linux, + is_Mac, + is_Windows, is_python3, work_path ) @@ -65,7 +69,7 @@ class Config(object): # print(_("DEBUG: Read configuration file %s") % path) self.config_path = path except UnicodeDecodeError as e: - print(_("Error decoding config file '%s': %s") % (path, e)) + print(_("Error decoding config file '{0}': {1}").format(path, e)) sys.exit(1) break