From 94b4c1bb4fb787988d25e28c9684fad604983e2b Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Sat, 10 Jun 2023 16:30:44 +0800 Subject: [PATCH] add traceback --- nuitka_build.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/nuitka_build.py b/nuitka_build.py index 7b0604b..da42805 100644 --- a/nuitka_build.py +++ b/nuitka_build.py @@ -9,6 +9,7 @@ import sys import time import shutil import zipfile +import traceback import subprocess from pathlib import Path @@ -64,12 +65,15 @@ if __name__ == '__main__': print(f'Compile Time: {time.time_ns() - start_time} ns ({(time.time_ns() - start_time) / 1000_000_000} s)') if is_github: # 去除无用字体文件 - shutil.rmtree(compiler.output_path / 'DR.dist' / 'fonts' / 'Fira_Code', ignore_errors=True) - shutil.rmtree(compiler.output_path / 'DR.dist' / 'fonts' / 'scientifica', ignore_errors=True) - shutil.rmtree(compiler.output_path / 'DR.dist' / 'fonts' / 'HarmonyOS_Sans' / 'HarmonyOS_Sans_Condensed', ignore_errors=True) - shutil.rmtree(compiler.output_path / 'DR.dist' / 'fonts' / 'HarmonyOS_Sans' / 'HarmonyOS_Sans', ignore_errors=True) - os.remove(compiler.output_path / 'DR.dist' / 'fonts' / 'Monocraft.otf') - os.remove(compiler.output_path / 'DR.dist' / 'fonts' / 'SmileySans-Oblique.ttf') + try: + shutil.rmtree(compiler.output_path / 'DR.dist' / 'fonts' / 'Fira_Code', ignore_errors=True) + shutil.rmtree(compiler.output_path / 'DR.dist' / 'fonts' / 'scientifica', ignore_errors=True) + shutil.rmtree(compiler.output_path / 'DR.dist' / 'fonts' / 'HarmonyOS_Sans' / 'HarmonyOS_Sans_Condensed', ignore_errors=True) + shutil.rmtree(compiler.output_path / 'DR.dist' / 'fonts' / 'HarmonyOS_Sans' / 'HarmonyOS_Sans', ignore_errors=True) + os.remove(compiler.output_path / 'DR.dist' / 'fonts' / 'Monocraft.otf') + os.remove(compiler.output_path / 'DR.dist' / 'fonts' / 'SmileySans-Oblique.ttf') + except Exception: + traceback.print_exc() print('Remove Useless Files Done!') # 压缩 with zipfile.ZipFile(Path('./build/Difficult_Rocket.zip'), 'w', zipfile.ZIP_DEFLATED, compresslevel=9) as dist_zip: