diff --git a/clients/client-linux.py b/clients/client-linux.py
index b4ad4b7..c28435a 100755
--- a/clients/client-linux.py
+++ b/clients/client-linux.py
@@ -151,10 +151,10 @@ def get_network(ip_version):
         HOST = "ipv6.google.com"
     try:
         s = socket.create_connection((HOST, 80), 2)
+        s.close()
         return True
     except:
-        pass
-    return False
+        return False
 
 lostRate = {
     '10010': 0.0,
diff --git a/clients/client-psutil.py b/clients/client-psutil.py
index f054426..77dee21 100755
--- a/clients/client-psutil.py
+++ b/clients/client-psutil.py
@@ -119,10 +119,10 @@ def get_network(ip_version):
         HOST = "ipv6.google.com"
     try:
         s = socket.create_connection((HOST, 80), 2)
+        s.close()
         return True
     except:
-        pass
-    return False
+        return False
 
 lostRate = {
     '10010': 0.0,