Omit Config keys that have falsey values (empty)
This commit is contained in:
parent
d1bbd8cfe3
commit
eb0c13971a
1 changed files with 1 additions and 1 deletions
|
@ -11,7 +11,7 @@ class Config(object):
|
|||
with open(self.location) as config_file:
|
||||
parser = configparser.ConfigParser()
|
||||
parser.read_string(config_file.read())
|
||||
self._config = dict(parser["bot"].items())
|
||||
self._config = {k: v for k, v in parser["bot"].items() if v}
|
||||
|
||||
def __getitem__(self, key: str) -> typing.Any:
|
||||
return self._config[key]
|
||||
|
|
Loading…
Reference in a new issue