From 8c231fb7b7d60ded06521023456fd303cda8c78d Mon Sep 17 00:00:00 2001 From: dusoleil Date: Tue, 31 Aug 2021 19:32:24 -0400 Subject: Use With Statement for Temporary Directory Signed-off-by: dusoleil --- sploit/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sploit/main.py b/sploit/main.py index ebcbd41..6d181b8 100644 --- a/sploit/main.py +++ b/sploit/main.py @@ -25,10 +25,10 @@ def main(): def daemon(script): print("Running in Pipe Daemon Mode...") - tmpdir = tempfile.TemporaryDirectory() - tmp = os.path.split(tmpdir.name)[1] - while(True): - runscript(script,Comm(Pipes(tmp))); + with tempfile.TemporaryDirectory() as tmpdir: + tmp = os.path.split(tmpdir)[1] + while(True): + runscript(script,Comm(Pipes(tmp))); def pipe(script): print("Running in Pipe Mode..."); -- cgit v1.2.3