From 1fbfc81cd69c01ab24f4e915c7cf07d8f1a85ac6 Mon Sep 17 00:00:00 2001
From: gary_williams <gary_williams@localhost>
Date: Wed, 30 Jan 2008 18:10:45 +0000
Subject: [PATCH] ensure files closed in aci tests
---
opendj-sdk/opends/tests/shared/python/security.py | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/opendj-sdk/opends/tests/shared/python/security.py b/opendj-sdk/opends/tests/shared/python/security.py
index 9ef873b..16e3d62 100644
--- a/opendj-sdk/opends/tests/shared/python/security.py
+++ b/opendj-sdk/opends/tests/shared/python/security.py
@@ -29,8 +29,12 @@
aci_file = open(filename,"r")
ret_str = ""
- for line in aci_file.readlines():
+ try:
+ for line in aci_file.readlines():
aci_index = line.find("aci:")
if aci_index > -1:
- ret_str = ret_str + line
- return ret_str
+ ret_str = ret_str + line
+ return ret_str
+ finally:
+ aci_file.close()
+
--
Gitblit v1.10.0