From 2ad7ed2ff2858ec839eb70ea2a5c5e70f3d9b114 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Sun, 22 Sep 2024 14:20:34 +0100 Subject: [PATCH] Fix not returning values from safe_write functions --- matchy/state.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/matchy/state.py b/matchy/state.py index 56fbb1d..fe24411 100644 --- a/matchy/state.py +++ b/matchy/state.py @@ -232,11 +232,12 @@ class _State(): @wraps(func) def inner(self, *args, **kwargs): tmp = _State(self._dict, self._file) - func(tmp, *args, **kwargs) + ret = func(tmp, *args, **kwargs) _SCHEMA.validate(tmp._dict) if tmp._file: _save(tmp._file, tmp._dict) self._dict = tmp._dict + return ret return inner