From 93c91b8f7773b19b1aeddbeb53b3d67f4383ae17 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Mon, 5 Jun 2023 14:04:43 +0200 Subject: [PATCH] wip: 2023-06-05T12:12:07+0200 (1685959927) --- .gitignore | 1 + reflect_client/Client.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a5eb7d5..8a6e900 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ Homestead.yaml npm-debug.log yarn-error.log public/robots.txt +__pycache__ # OS generated files # ###################### diff --git a/reflect_client/Client.py b/reflect_client/Client.py index 1ca2e3a..aa6d1b3 100644 --- a/reflect_client/Client.py +++ b/reflect_client/Client.py @@ -47,7 +47,9 @@ class Client: # Close socket connection when class instance removed def __del__(self): - self._socket.close() + # Close socket if connected + if (self._con == Connection.AF_UNIX): + self._socket.close() # Resolve connection type from endpoint string. # If the string is a valid URL we will treat it as HTTP otherwise we will assume it's a path on disk to a UNIX socket file.