mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Remove the __del__
instead
This commit is contained in:
parent
fd03c83b74
commit
fd10f104d7
2 changed files with 3 additions and 9 deletions
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue