mirror of
https://github.com/python/cpython.git
synced 2025-12-04 08:34:25 +00:00
This commit is contained in:
commit
1bcab66811
1 changed files with 4 additions and 0 deletions
|
|
@ -417,6 +417,8 @@ class FileWrapperTest(unittest.TestCase):
|
||||||
# Issue #11453
|
# Issue #11453
|
||||||
fd = os.open(support.TESTFN, os.O_RDONLY)
|
fd = os.open(support.TESTFN, os.O_RDONLY)
|
||||||
f = asyncore.file_wrapper(fd)
|
f = asyncore.file_wrapper(fd)
|
||||||
|
|
||||||
|
os.close(fd)
|
||||||
with support.check_warnings(('', ResourceWarning)):
|
with support.check_warnings(('', ResourceWarning)):
|
||||||
f = None
|
f = None
|
||||||
support.gc_collect()
|
support.gc_collect()
|
||||||
|
|
@ -424,6 +426,8 @@ class FileWrapperTest(unittest.TestCase):
|
||||||
def test_close_twice(self):
|
def test_close_twice(self):
|
||||||
fd = os.open(support.TESTFN, os.O_RDONLY)
|
fd = os.open(support.TESTFN, os.O_RDONLY)
|
||||||
f = asyncore.file_wrapper(fd)
|
f = asyncore.file_wrapper(fd)
|
||||||
|
os.close(fd)
|
||||||
|
|
||||||
f.close()
|
f.close()
|
||||||
self.assertEqual(f.fd, -1)
|
self.assertEqual(f.fd, -1)
|
||||||
# calling close twice should not fail
|
# calling close twice should not fail
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue