diff options
author | dusoleil <howcansocksbereal@gmail.com> | 2021-08-31 19:32:24 -0400 |
---|---|---|
committer | dusoleil <howcansocksbereal@gmail.com> | 2021-08-31 19:32:24 -0400 |
commit | 8c231fb7b7d60ded06521023456fd303cda8c78d (patch) | |
tree | 40459f5b6962e1fddf2f9d150a3fcf22c2ada7ae | |
parent | e342ae082960cad4d05d719914801f907cd9d61d (diff) | |
download | sploit-8c231fb7b7d60ded06521023456fd303cda8c78d.tar.gz sploit-8c231fb7b7d60ded06521023456fd303cda8c78d.zip |
Use With Statement for Temporary Directory
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
-rw-r--r-- | sploit/main.py | 8 |
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..."); |