Skip to content
This repository was archived by the owner on Nov 23, 2017. It is now read-only.

Commit 532c096

Browse files
ronfasvetlov
authored andcommitted
Fix an unclosed transport error in test_events (#410)
When running the asyncio unit tests, I noticed that I was seeing the following error from test_ssl_connect_accepted_socket(): /Volumes/ronf/src/asyncio/asyncio/sslproto.py:328: ResourceWarning: unclosed transport <asyncio.sslproto._SSLProtocolTransport object at 0x10d7d57b8> warnings.warn("unclosed transport %r" % self, ResourceWarning) This commit fixes this error by calling close on the transport which is opened rather than calling close on the socket of the accepted connection used to create it.
1 parent 0d750ae commit 532c096

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/test_events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ def client():
793793
loop.connect_accepted_socket(
794794
(lambda : proto), conn, ssl=server_ssl))
795795
loop.run_forever()
796-
conn.close()
796+
proto.transport.close()
797797
lsock.close()
798798

799799
thread.join(1)

0 commit comments

Comments
 (0)