From 26b1c7a2c68d0747784cc5cebe71f835e8e24255 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 --- tools/sploit/sploit/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/sploit/sploit/main.py b/tools/sploit/sploit/main.py index ebcbd41..6d181b8 100644 --- a/tools/sploit/sploit/main.py +++ b/tools/sploit/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