diff options
author | Kali Kaneko <kali@leap.se> | 2013-05-01 04:05:03 +0900 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2013-05-01 04:07:16 +0900 |
commit | f74c32a4a8e9eae9c8055c25d3848ff7d836e308 (patch) | |
tree | ef1a67d7d7aa38a31fde0d00e41c5c735c71a444 | |
parent | 1ae67202f1878106a3a9770d22dcb695f604d5ee (diff) |
return None if no key found, avoid KeyError
-rw-r--r-- | setup.py | 2 | ||||
-rw-r--r-- | src/leap/common/__init__.py | 2 | ||||
-rw-r--r-- | src/leap/common/config/baseconfig.py | 3 |
3 files changed, 3 insertions, 4 deletions
@@ -41,7 +41,7 @@ setup( name='leap.common', # If you change version, do it also in # src/leap/common/__init__.py - version='0.2.1-dev', + version='0.2.1-dev2', url='https://leap.se/', license='GPLv3+', author='The LEAP Encryption Access Project', 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) |