Remove unused temp dir variables that leaked on every invocation

utils_dir, temp_dir, build_dir, and staging_dir were computed at
module level but never referenced. tempfile.mkdtemp() ran
unconditionally on every invocation (including --help and
argument-parse errors), leaking an empty temp directory on disk
each time. Remove all four variables and the now-unused tempfile
import.
This commit is contained in:
Duo Developer
2026-08-28 09:51:24 +00:00
committed by admin
parent d2a4558a39
commit b9d8c82f19
+1 -5
View File
@@ -1,6 +1,6 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
import sys, os, argparse, json, shutil, tempfile, subprocess, traceback import sys, os, argparse, json, shutil, subprocess, traceback
def run_script(script_path: str) -> int: def run_script(script_path: str) -> int:
""" """
@@ -131,10 +131,6 @@ def uninstall_app(args: argparse.Namespace, install_path) -> int:
return rval return rval
# script constants # script constants
utils_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
temp_dir = tempfile.mkdtemp()
build_dir = os.path.join(temp_dir, 'build')
staging_dir = os.path.join(temp_dir, 'staging')
working_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) working_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
src_path = os.path.join(working_dir, 'src') src_path = os.path.join(working_dir, 'src')
CONFIG_JSON = os.path.join(working_dir, 'config.json') CONFIG_JSON = os.path.join(working_dir, 'config.json')