Skip to content

Commit 9a82992

Browse files
author
Bryan Howard
committed
trying to hide the terminal in the compiled version
1 parent 61d8743 commit 9a82992

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

environment_manager.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ def run(self):
6161
def run_setup(self):
6262
self.progress.emit("--- STARTING SETUP PROCESS ---")
6363

64-
# --- Hide Console Window on Windows ---
65-
creation_flags = 0
66-
if sys.platform == "win32":
67-
creation_flags = subprocess.CREATE_NO_WINDOW
68-
6964
if not os.path.exists(self.venv_path):
7065
self.progress.emit(f"Target venv path does not exist: {self.venv_path}")
7166
self.progress.emit("Attempting to create new virtual environment...")
@@ -95,7 +90,7 @@ def run_setup(self):
9590
self.progress.emit(f"DEBUG: Subprocess command to run: {cmd}")
9691

9792
# No need to set cwd, as we use an absolute path to the executable.
98-
result = subprocess.run(cmd, capture_output=True, text=True, encoding="utf-8", creationflags=creation_flags)
93+
result = subprocess.run(cmd, capture_output=True, text=True, encoding="utf-8", creationflags=subprocess.CREATE_NO_WINDOW)
9994

10095
if result.returncode != 0:
10196
self.progress.emit(f"ERROR: Subprocess failed with return code {result.returncode}.")
@@ -143,11 +138,7 @@ def run_verify(self):
143138
self.progress.emit("Checking installed packages...")
144139
cmd = [venv_python_exe, "-m", "pip", "freeze"]
145140

146-
creation_flags = 0
147-
if sys.platform == "win32":
148-
creation_flags = subprocess.CREATE_NO_WINDOW
149-
150-
result = subprocess.run(cmd, capture_output=True, text=True, encoding="utf-8", creationflags=creation_flags)
141+
result = subprocess.run(cmd, capture_output=True, text=True, encoding="utf-8", creationflags=subprocess.CREATE_NO_WINDOW)
151142
if result.returncode != 0:
152143
self.finished.emit(False, "Verification Failed: Could not list installed packages.")
153144
return

graph_executor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ def execute(self):
9393
)
9494

9595
try:
96-
process = subprocess.run([python_exe, "-c", runner_script], input=json.dumps(inputs_for_function), capture_output=True, text=True, check=True)
96+
process = subprocess.run(
97+
[python_exe, "-c", runner_script], input=json.dumps(inputs_for_function), capture_output=True, text=True, check=True, creationflags=subprocess.CREATE_NO_WINDOW
98+
)
9799

98100
response = json.loads(process.stdout)
99101
result = response.get("result")

0 commit comments

Comments
 (0)