diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2013-11-25 17:01:24 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2013-11-25 17:01:24 +0900 |
commit | 9c798b119c012ad8cacced0b80f988d24d9d2ae0 (patch) | |
tree | a7885a6c07923277269293c8d2b65756bf51b2ab | |
parent | 828b9f872f9c9df4a26fff043e48e13d59cce70b (diff) | |
download | ansible-9c798b119c012ad8cacced0b80f988d24d9d2ae0.tar.gz |
Remove Python 2.4-incompatible 'with' statement
-rw-r--r-- | library/utilities/wait_for | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/library/utilities/wait_for b/library/utilities/wait_for index 8644673eb5..a175afc415 100644 --- a/library/utilities/wait_for +++ b/library/utilities/wait_for @@ -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 |