aboutsummaryrefslogtreecommitdiffstats
path: root/config_file/config_file.py
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2020-03-29 19:53:20 -0500
committerEugene Triguba <eugenetriguba@gmail.com>2020-03-29 19:53:20 -0500
commitbddd5d9cb7b81727fa6f8a8ff080d788fc5653af (patch)
treec25d3caaff68ba33f35ae3a721f5ff727d4e471a /config_file/config_file.py
parentFix lock file and add extras to CI (diff)
downloadconfig-file-bddd5d9cb7b81727fa6f8a8ff080d788fc5653af.zip
retrieve_all is now get_all and fixed bug with coerceing default return
type
Diffstat (limited to 'config_file/config_file.py')
-rw-r--r--config_file/config_file.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/config_file/config_file.py b/config_file/config_file.py
index aae3b74..91202da 100644
--- a/config_file/config_file.py
+++ b/config_file/config_file.py
@@ -81,13 +81,14 @@ class ConfigFile:
:return: The value of the key.
"""
- if default is not None:
+ if default is None:
+ key_value = self.parser.get(key, parse_types=parse_types)
+ else:
try:
- return self.parser.get(key, parse_types=parse_types)
+ key_value = self.parser.get(key, parse_types=parse_types)
except ParsingError:
return default
- key_value = self.parser.get(key, parse_types=parse_types)
return return_type(key_value) if return_type else key_value
def set(self, key: str, value):