Commit 803d07a7 authored by Laurent Bachelier's avatar Laurent Bachelier 🐧 Committed by ntome

config: Allow usage as a context manager

parent 6791c338
......@@ -69,3 +69,9 @@ class IConfig(object):
:param default: if specified, default value when path is not found
"""
raise NotImplementedError()
def __enter__(self):
self.load()
def __exit__(self, t, v, tb):
self.save()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment