Browse Source

locking fix

PYADPT-55
Volker Birk 6 years ago
parent
commit
5dc842749d
  1. 8
      test/minimail.py

8
test/minimail.py

@ -77,15 +77,15 @@ def recv_all(inbox, marker):
r = [] r = []
while not r: while not r:
for p in reversed([ path for path in inbox.glob("*.eml") ]): with Lock(inbox):
if newer(p, inbox / marker): for p in reversed([ path for path in inbox.glob("*.eml") ]):
with Lock(inbox): if newer(p, inbox / marker):
with open(p, "rb") as f: with open(p, "rb") as f:
t = f.read(-1) t = f.read(-1)
r.append(t) r.append(t)
(inbox / marker).touch(exist_ok=True)
if not r: if not r:
sleep(1) sleep(1)
(inbox / marker).touch(exist_ok=True)
return r return r

Loading…
Cancel
Save