changeset: 91912:0ced2d2325fb parent: 91910:16ef196886a6 parent: 91911:379aad232000 user: Victor Stinner date: Tue Jul 29 01:01:43 2014 +0200 files: Lib/test/test_asyncore.py description: (Merge 3.4) Issue #11453, #18174: Fix leak of file descriptor in test_asyncore diff -r 16ef196886a6 -r 0ced2d2325fb Lib/test/test_asyncore.py --- a/Lib/test/test_asyncore.py Tue Jul 29 00:45:19 2014 +0200 +++ b/Lib/test/test_asyncore.py Tue Jul 29 01:01:43 2014 +0200 @@ -417,6 +417,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() @@ -424,6 +426,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