diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-07-28 23:01:43 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-07-28 23:01:43 (GMT) |
commit | 1bcab668112e9b3f17ad5e85e47f41137d997623 (patch) | |
tree | 41c4c02b174dfc754f1e64455e59194b912e7547 /Lib/test/test_asyncore.py | |
parent | eb05576aad335e47fcb5e497d65f57e945f1fa6d (diff) | |
parent | 623138c1635f865fac4ab45af34048d5c7f42e37 (diff) | |
download | cpython-1bcab668112e9b3f17ad5e85e47f41137d997623.zip cpython-1bcab668112e9b3f17ad5e85e47f41137d997623.tar.gz cpython-1bcab668112e9b3f17ad5e85e47f41137d997623.tar.bz2 |
(Merge 3.4) Issue #11453, #18174: Fix leak of file descriptor in test_asyncore
Diffstat (limited to 'Lib/test/test_asyncore.py')
-rw-r--r-- | Lib/test/test_asyncore.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py index 8882b80..3857916 100644 --- a/Lib/test/test_asyncore.py +++ b/Lib/test/test_asyncore.py @@ -417,6 +417,8 @@ class FileWrapperTest(unittest.TestCase): # 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 @@ class FileWrapperTest(unittest.TestCase): 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 |