From 1393c88277643a55a246d6f9641d134b288b8b30 Mon Sep 17 00:00:00 2001 From: Daniel Goldberg Date: Wed, 27 Nov 2019 13:55:39 +0200 Subject: [PATCH] Move out of try, can't realistically fail --- monkey/infection_monkey/transport/tcp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/infection_monkey/transport/tcp.py b/monkey/infection_monkey/transport/tcp.py index 22cff5d4a..9b017aa41 100644 --- a/monkey/infection_monkey/transport/tcp.py +++ b/monkey/infection_monkey/transport/tcp.py @@ -61,8 +61,8 @@ class TcpProxy(TransportProxyBase): except socket.timeout: continue + dest = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: - dest = socket.socket(socket.AF_INET, socket.SOCK_STREAM) dest.connect((self.dest_host, self.dest_port)) except socket.error as ex: source.close()