Skip to content

Commit f8ac154

Browse files
committed
добавил вывод ошибки компиляции
1 parent f735563 commit f8ac154

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

‎main.py‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -600,27 +600,29 @@ def world_in_worlds_list(world,l):
600600

601601
print(f"{GREEN}--- Трансляция завершена ({output_file}) ---{RESET}")
602602

603-
if build:
603+
if build:
604604
print(f"{YELLOW} Запущена компиляция программы: {input_file} в {input_path.with_suffix('.exe')} ")
605-
605+
606606
python_path = find_local_python()
607-
607+
608608
if "не найден" in python_path:
609609
print(f"{RED}Ошибка: Python не найден, компиляция невозможна.{RESET}")
610610
return
611-
611+
612612
try:
613613
result = subprocess.run(
614614
[python_path, "-m", "PyInstaller", "--onefile", "--noconsole", str(output_file)],
615+
capture_output=True,
615616
text=True
616617
)
617618
if result.returncode == 0:
618619
print(f"{GREEN}Компиляция завершена успешно!{RESET}")
619620
else:
620-
print(f"{RED}Ошибка при компиляции.{RESET}")
621+
print(f"{RED}Ошибка при компиляции:{RESET}")
622+
print(result.stderr)
621623
except Exception as e:
622624
print(f"{RED}Не удалось запустить PyInstaller: {e}{RESET}")
623-
625+
624626
return
625627
# Запуск
626628
from contextlib import redirect_stdout

0 commit comments

Comments
 (0)