Remove the __del__ instead

This commit is contained in:
MKLeb 2023-03-24 11:36:07 -04:00
parent fd03c83b74
commit fd10f104d7
2 changed files with 3 additions and 9 deletions

View file

@ -44,7 +44,7 @@ def run():
}
"""
)
base_tree = pathlib.Path(salt_master.config["file_roots"][0])
base_tree = pathlib.Path(salt_master.config["file_roots"]["base"][0])
breaks_tree = base_tree / "breaks"
breaks_tree.mkdir(exist_ok=True)
(breaks_tree / "init.sls").write_text(init_sls)

View file

@ -524,7 +524,6 @@ class AsyncReqMessageClient:
# The python interpreter has nuked most attributes already
return
else:
teardown = False
self._closing = True
if hasattr(self, "stream") and self.stream is not None:
if ZMQ_VERSION_INFO < (14, 3, 0):
@ -536,15 +535,10 @@ class AsyncReqMessageClient:
self.stream.socket = None
self.socket.close()
else:
try:
self.stream.close(1)
except ImportError:
# On teardown of python, this can sometimes throw and ImportError
# because sys.meta_path turns to None
teardown = True
self.stream.close(1)
self.socket = None
self.stream = None
if self.context.closed is False and not teardown:
if self.context.closed is False:
# This hangs if closing the stream causes an import error
self.context.term()