From f74c32a4a8e9eae9c8055c25d3848ff7d836e308 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 1 May 2013 04:05:03 +0900 Subject: return None if no key found, avoid KeyError --- src/leap/common/__init__.py | 2 +- src/leap/common/config/baseconfig.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src/leap') diff --git a/src/leap/common/__init__.py b/src/leap/common/__init__.py index 19c43c9..a5ea197 100644 --- a/src/leap/common/__init__.py +++ b/src/leap/common/__init__.py @@ -16,4 +16,4 @@ except ImportError: __all__ = ["certs", "check", "files", "events"] -__version__ = "0.2.1-dev" +__version__ = "0.2.1-dev2" diff --git a/src/leap/common/config/baseconfig.py b/src/leap/common/config/baseconfig.py index edb9b24..146f1e4 100644 --- a/src/leap/common/config/baseconfig.py +++ b/src/leap/common/config/baseconfig.py @@ -70,12 +70,11 @@ class BaseConfig: @return: returns the value for the specified key in the config """ leap_assert(self._config_checker, "Load the config first") - return self._config_checker.config[key] + return self._config_checker.config.get(key, None) def get_path_prefix(self): """ Returns the platform dependant path prefixer - """ return get_platform_prefixer().get_path_prefix( standalone=self.standalone) -- cgit v1.2.3