10000 test_defer_connect: don't leak file descriptor (#660) · jiangsanyin/PyMySQL@24ecee6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 24ecee6

Browse files
grooverdanmethane
authored andcommitted
test_defer_connect: don't leak file descriptor (PyMySQL#660)
1 parent ed3eacd commit 24ecee6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pymysql/tests/test_connection.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@ def test_defer_connect(self):
471471
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
472472
sock.connect(d['unix_socket'])
473473
except KeyError:
474+
sock.close()
474475
sock = socket.create_connection(
475476
(d.get('host', 'localhost'), d.get('port', 3306)))
476477
for k in ['unix_socket', 'host', 'port']:

0 commit comments

Comments
 (0)
0