From 95bb7bd7f9ca8c70ebe4596fbd4aaa06112a115b Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Fri, 29 Aug 2025 12:36:32 +0200 Subject: [PATCH] Declare functions instead of assigning to lambdas --- vdirsyncer/sync/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vdirsyncer/sync/__init__.py b/vdirsyncer/sync/__init__.py index e8db4d1..292976e 100644 --- a/vdirsyncer/sync/__init__.py +++ b/vdirsyncer/sync/__init__.py @@ -136,9 +136,13 @@ async def sync( raise BothReadOnly if conflict_resolution == "a wins": - conflict_resolution = lambda a, b: a + + def conflict_resolution(a, b): + return a elif conflict_resolution == "b wins": - conflict_resolution = lambda a, b: b + + def conflict_resolution(a, b): + return b status_nonempty = bool(next(status.iter_old(), None))