From 5dc842749d31d45bd7039d98f0a2031831662a3f Mon Sep 17 00:00:00 2001 From: Volker Birk Date: Fri, 22 Mar 2019 13:16:03 +0100 Subject: [PATCH] locking fix --- test/minimail.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/minimail.py b/test/minimail.py index 8ffd49f..11fb91a 100644 --- a/test/minimail.py +++ b/test/minimail.py @@ -77,15 +77,15 @@ def recv_all(inbox, marker): r = [] while not r: - for p in reversed([ path for path in inbox.glob("*.eml") ]): - if newer(p, inbox / marker): - with Lock(inbox): + with Lock(inbox): + for p in reversed([ path for path in inbox.glob("*.eml") ]): + if newer(p, inbox / marker): with open(p, "rb") as f: t = f.read(-1) r.append(t) + (inbox / marker).touch(exist_ok=True) if not r: sleep(1) - (inbox / marker).touch(exist_ok=True) return r