From 513a1a22150f040459326a92e805c46d8d1eadb1 Mon Sep 17 00:00:00 2001 From: Tom Van Braeckel Date: Thu, 12 Feb 2015 15:45:24 +0100 Subject: [PATCH] Improve handling of None values in the configuration file When wireless_interface is not filled in, it should be autodetected. But because this is set to None, the autodetection fails... --- wicd/configmanager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wicd/configmanager.py b/wicd/configmanager.py index 4fd8498..ae63a31 100644 --- a/wicd/configmanager.py +++ b/wicd/configmanager.py @@ -112,8 +112,9 @@ class ConfigManager(RawConfigParser): self.add_section(section) else: return None - - if self.has_option(section, option): + + # If the option is present and not empty + if self.has_option(section, option) and RawConfigParser.get(self, section, option) != "None": ret = RawConfigParser.get(self, section, option) if (isinstance(ret, basestring) and ret.startswith(self.mrk_ws) and ret.endswith(self.mrk_ws)):