summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordusoleil <howcansocksbereal@gmail.com>2021-08-31 19:32:24 -0400
committerdusoleil <howcansocksbereal@gmail.com>2021-08-31 19:32:24 -0400
commit8c231fb7b7d60ded06521023456fd303cda8c78d (patch)
tree40459f5b6962e1fddf2f9d150a3fcf22c2ada7ae
parente342ae082960cad4d05d719914801f907cd9d61d (diff)
downloadsploit-8c231fb7b7d60ded06521023456fd303cda8c78d.tar.gz
sploit-8c231fb7b7d60ded06521023456fd303cda8c78d.zip
Use With Statement for Temporary Directory
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
-rw-r--r--sploit/main.py8
1 files 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...");