mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
Always try to remove the test file even if close raises an exception
This commit is contained in:
parent
739a3c40e6
commit
a121508fac
1 changed files with 1 additions and 2 deletions
|
|
@ -15,7 +15,6 @@ def test_args(self):
|
||||||
self.assertRaises(TypeError, resource.setrlimit, 42, 42, 42)
|
self.assertRaises(TypeError, resource.setrlimit, 42, 42, 42)
|
||||||
|
|
||||||
def test_fsize_ismax(self):
|
def test_fsize_ismax(self):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
(cur, max) = resource.getrlimit(resource.RLIMIT_FSIZE)
|
(cur, max) = resource.getrlimit(resource.RLIMIT_FSIZE)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
|
@ -63,10 +62,10 @@ def test_fsize_enforced(self):
|
||||||
resource.setrlimit(resource.RLIMIT_FSIZE, (cur, max))
|
resource.setrlimit(resource.RLIMIT_FSIZE, (cur, max))
|
||||||
finally:
|
finally:
|
||||||
f.close()
|
f.close()
|
||||||
os.unlink(test_support.TESTFN)
|
|
||||||
finally:
|
finally:
|
||||||
if limit_set:
|
if limit_set:
|
||||||
resource.setrlimit(resource.RLIMIT_FSIZE, (cur, max))
|
resource.setrlimit(resource.RLIMIT_FSIZE, (cur, max))
|
||||||
|
test_support.unlink(test_support.TESTFN)
|
||||||
|
|
||||||
def test_fsize_toobig(self):
|
def test_fsize_toobig(self):
|
||||||
# Be sure that setrlimit is checking for really large values
|
# Be sure that setrlimit is checking for really large values
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue