From 3dac4dfd17dc6a5a3fc916bb016f57fd406d4f7b Mon Sep 17 00:00:00 2001
From: macos <tengyue.li@100credit.com>
Date: Mon, 22 Jun 2020 11:33:24 +0800
Subject: [PATCH] update

---
 clients/client-linux.py  | 7 ++++---
 clients/client-psutil.py | 7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/clients/client-linux.py b/clients/client-linux.py
index 88909f9..8fa8bb2 100755
--- a/clients/client-linux.py
+++ b/clients/client-linux.py
@@ -344,10 +344,11 @@ if __name__ == '__main__':
             raise
         except socket.error:
             print("Disconnected...")
-            # keep on trying after a disconnect
-            s.close()
+            if 's' in locals().keys():
+                del s
             time.sleep(3)
         except Exception as e:
             print("Caught Exception:", e)
-            s.close()
+            if 's' in locals().keys():
+                del s
             time.sleep(3)
diff --git a/clients/client-psutil.py b/clients/client-psutil.py
index bffa407..799ce56 100755
--- a/clients/client-psutil.py
+++ b/clients/client-psutil.py
@@ -325,10 +325,11 @@ if __name__ == '__main__':
             raise
         except socket.error:
             print("Disconnected...")
-            # keep on trying after a disconnect
-            s.close()
+            if 's' in locals().keys():
+                del s
             time.sleep(3)
         except Exception as e:
             print("Caught Exception:", e)
-            s.close()
+            if 's' in locals().keys():
+                del s
             time.sleep(3)