From 3c0cdd74ec1d8df3e452a6653f20bad6252b971c Mon Sep 17 00:00:00 2001 From: Mohammed Junaid Date: Thu, 30 May 2013 06:20:55 +0530 Subject: Moved closing of fd1 to the inner try block in the test_do_write_err function. This is a follow up change to the previous commit to fs_utils unit test case patch. Change-Id: I677683677071efc6176ad2145d1806bc7e658c9e Signed-off-by: Mohammed Junaid Reviewed-on: http://review.gluster.org/5116 Reviewed-by: Peter Portante Tested-by: Peter Portante --- test/unit/common/test_fs_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/common/test_fs_utils.py b/test/unit/common/test_fs_utils.py index eb6faa0..559c7db 100644 --- a/test/unit/common/test_fs_utils.py +++ b/test/unit/common/test_fs_utils.py @@ -87,7 +87,7 @@ class TestFsUtils(unittest.TestCase): except OSError: pass else: - self.fail("IOError expected") + self.fail("OSError expected") def test_do_write(self): fd, tmpfile = mkstemp() @@ -108,10 +108,10 @@ class TestFsUtils(unittest.TestCase): pass else: self.fail("OSError expected") + finally: + os.close(fd1) except OSError as ose: self.fail("Open failed with %s" %ose.strerror) - else: - os.close(fd1) finally: os.close(fd) os.remove(tmpfile) -- cgit