mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-26 00:16:49 +00:00
Merge pull request #5045 from junegunn/wait_for-python2.4
Remove Python 2.4-incompatible 'with' statement
This commit is contained in:
@@ -157,7 +157,8 @@ def main():
|
||||
while datetime.datetime.now() < end:
|
||||
if path:
|
||||
try:
|
||||
with open(path) as f:
|
||||
f = open(path)
|
||||
try:
|
||||
if search_regex:
|
||||
if re.search(search_regex, f.read(), re.MULTILINE):
|
||||
break
|
||||
@@ -165,6 +166,8 @@ def main():
|
||||
time.sleep(1)
|
||||
else:
|
||||
break
|
||||
finally:
|
||||
f.close()
|
||||
except IOError:
|
||||
time.sleep(1)
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user