Kaydet (Commit) 3e7dd783 authored tarafından Hirokazu Yamamoto's avatar Hirokazu Yamamoto

Issue #3759: test_asyncore.py leaked handle.

Reviewed by Amaury Forgeot d'Arc
üst 3e75d233
...@@ -389,6 +389,7 @@ if hasattr(asyncore, 'file_wrapper'): ...@@ -389,6 +389,7 @@ if hasattr(asyncore, 'file_wrapper'):
def test_recv(self): def test_recv(self):
fd = os.open(TESTFN, os.O_RDONLY) fd = os.open(TESTFN, os.O_RDONLY)
w = asyncore.file_wrapper(fd) w = asyncore.file_wrapper(fd)
os.close(fd)
self.assertNotEqual(w.fd, fd) self.assertNotEqual(w.fd, fd)
self.assertNotEqual(w.fileno(), fd) self.assertNotEqual(w.fileno(), fd)
...@@ -402,6 +403,7 @@ if hasattr(asyncore, 'file_wrapper'): ...@@ -402,6 +403,7 @@ if hasattr(asyncore, 'file_wrapper'):
d2 = "I want to buy some cheese." d2 = "I want to buy some cheese."
fd = os.open(TESTFN, os.O_WRONLY | os.O_APPEND) fd = os.open(TESTFN, os.O_WRONLY | os.O_APPEND)
w = asyncore.file_wrapper(fd) w = asyncore.file_wrapper(fd)
os.close(fd)
w.write(d1) w.write(d1)
w.send(d2) w.send(d2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment