summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncore.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-07-28 23:01:09 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-07-28 23:01:09 (GMT)
commit623138c1635f865fac4ab45af34048d5c7f42e37 (patch)
treec8fe2618307040c19e8527ed3ef22da16777c738 /Lib/test/test_asyncore.py
parent0970657f0160be42222aaaf7d29de097d67ee183 (diff)
downloadcpython-623138c1635f865fac4ab45af34048d5c7f42e37.zip
cpython-623138c1635f865fac4ab45af34048d5c7f42e37.tar.gz
cpython-623138c1635f865fac4ab45af34048d5c7f42e37.tar.bz2
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.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py
index 6cfe580..d44726d 100644
--- a/Lib/test/test_asyncore.py
+++ b/Lib/test/test_asyncore.py
@@ -440,6 +440,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()
@@ -447,6 +449,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