Commit 5bd4f419 authored by Antoine Millet's avatar Antoine Millet
Browse files

Added the ability to use with statement with CCConf.

parent 00e219e4
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -64,6 +64,12 @@ class CCConf(object):
        self._path = path_directory
        self._lock = threading.RLock()

    def __enter__(self):
        return self._lock.__enter__()

    def __exit__(self, *args, **kwargs):
        return self._lock.__exit__(*args, **kwargs)

    def _writer(func):
        '''
        Decorator used to threadsafize methods that made write operations on