changeset: 91911:379aad232000 branch: 3.4 parent: 91909:bc70c1da7faf user: Victor Stinner date: Tue Jul 29 01:01:09 2014 +0200 files: Lib/test/test_asyncore.py description: Issue #11453, #18174: Fix leak of file descriptor in test_asyncore diff -r bc70c1da7faf -r 379aad232000 Lib/test/test_asyncore.py --- a/Lib/test/test_asyncore.py Tue Jul 29 00:40:50 2014 +0200 +++ b/Lib/test/test_asyncore.py Tue Jul 29 01:01:09 2014 +0200 @@ -440,6 +440,8 @@ # Issue #11453 fd = os.open(support.TESTFN, os.O_RDONLY) f = asyncore.file_wrapper(fd) + + os.close(fd) with support.check_warnings(('', ResourceWarning)): f = None support.gc_collect() @@ -447,6 +449,8 @@ def test_close_twice(self): fd = os.open(support.TESTFN, os.O_RDONLY) f = asyncore.file_wrapper(fd) + os.close(fd) + f.close() self.assertEqual(f.fd, -1) # calling close twice should not fail