mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-16 14:28:12 +00:00
Ignore IOErrors while we're still waiting
This commit is contained in:
@ -7,8 +7,12 @@ def await_file_contents(path, contents, timeout=10):
|
|||||||
while time.time() - start_time < timeout:
|
while time.time() - start_time < timeout:
|
||||||
print(" waiting for '{}'".format(path))
|
print(" waiting for '{}'".format(path))
|
||||||
if exists(path):
|
if exists(path):
|
||||||
|
try:
|
||||||
with open(path, 'r') as f:
|
with open(path, 'r') as f:
|
||||||
current = f.read()
|
current = f.read()
|
||||||
|
except IOError:
|
||||||
|
print("IOError; trying again")
|
||||||
|
else:
|
||||||
if current == contents:
|
if current == contents:
|
||||||
return True
|
return True
|
||||||
print(" file contents still mismatched")
|
print(" file contents still mismatched")
|
||||||
|
Reference in New Issue
Block a user