aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/configs/manager.py
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-07-21 00:00:26 +0800
committerAaron LI <aly@aaronly.me>2017-07-21 00:00:26 +0800
commitdc2abe21d24a04aa36b9c8bd2e95d32982c225f8 (patch)
tree0dd3beb7f790a426ecd74e04ae7675002d9de20b /fg21sim/configs/manager.py
parente81dc098d5c00e4b26cef44b4dc3651097d57041 (diff)
downloadfg21sim-dc2abe21d24a04aa36b9c8bd2e95d32982c225f8.tar.bz2
configs/manager.py: get_path() return None if value is an empty string
Signed-off-by: Aaron LI <aly@aaronly.me>
Diffstat (limited to 'fg21sim/configs/manager.py')
-rw-r--r--fg21sim/configs/manager.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/fg21sim/configs/manager.py b/fg21sim/configs/manager.py
index 172811a..44df01c 100644
--- a/fg21sim/configs/manager.py
+++ b/fg21sim/configs/manager.py
@@ -432,8 +432,8 @@ class ConfigManager:
-------
path : str
The absolute path (if user configuration loaded) or relative
- path specified by the input key, or ``None`` if specified
- config is ``None``.
+ path specified by the input key, or ``None`` if the specified
+ config has value of ``None`` or an empty string.
Raises
------
@@ -450,6 +450,9 @@ class ConfigManager:
if value is None:
logger.warning("Specified config '%s' is None or not exist" % key)
return None
+ if value == "":
+ logger.warning("Specified config '%s' is an empty string" % key)
+ return None
if not isinstance(value, str):
msg = "Specified config '%s' is non-string: %s" % (key, value)
logger.error(msg)