diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2008-01-26 21:02:45 +0000 |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2008-01-26 21:02:45 +0000 |
commit | a121508facdf571a128230a84b3d701c5970d3ff (patch) | |
tree | 7967510b66939f2bc3b9a40214844286e7787c95 /Lib/test/test_resource.py | |
parent | 739a3c40e607dbdb5913197a3c869bb445b7fe04 (diff) | |
download | cpython-git-a121508facdf571a128230a84b3d701c5970d3ff.tar.gz |
Always try to remove the test file even if close raises an exception
Diffstat (limited to 'Lib/test/test_resource.py')
-rw-r--r-- | Lib/test/test_resource.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py index 16e360f1a8..09ac4d53ca 100644 --- a/Lib/test/test_resource.py +++ b/Lib/test/test_resource.py @@ -15,7 +15,6 @@ class ResourceTest(unittest.TestCase): self.assertRaises(TypeError, resource.setrlimit, 42, 42, 42) def test_fsize_ismax(self): - try: (cur, max) = resource.getrlimit(resource.RLIMIT_FSIZE) except AttributeError: @@ -63,10 +62,10 @@ class ResourceTest(unittest.TestCase): resource.setrlimit(resource.RLIMIT_FSIZE, (cur, max)) finally: f.close() - os.unlink(test_support.TESTFN) finally: if limit_set: resource.setrlimit(resource.RLIMIT_FSIZE, (cur, max)) + test_support.unlink(test_support.TESTFN) def test_fsize_toobig(self): # Be sure that setrlimit is checking for really large values |