Skip to content
Snippets Groups Projects
Commit 00ea69e9 authored by ulif's avatar ulif
Browse files

py2.6 compatibility.

Older python versions (< 3.x?) do not support item
assignments with config parser instances. We have
to workaround therefore.
parent fb6f7659
No related branches found
No related tags found
No related merge requests found
......@@ -68,9 +68,9 @@ def get_config_dict(path_list=None):
"""
result = dict(OPTIONS_DEFAULTS)
found, parser = get_configparser(path_list)
if 'diceware' not in parser.sections():
if not parser.has_section("diceware"):
return result
conf = parser['diceware']
conf = dict(parser.items('diceware'))
for key, val in OPTIONS_DEFAULTS.items():
result[key] = conf.get(key, val)
return result
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment