From 7e92ce64219a50ec0776297084f8f04c956e80b4 Mon Sep 17 00:00:00 2001 From: lilingfengdev Date: Sat, 1 Jun 2024 18:16:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=A9=E5=B0=8F=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- generate-bundle.py | 5 ++--- utils.py | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/generate-bundle.py b/generate-bundle.py index 7b120bb..feb6ce4 100644 --- a/generate-bundle.py +++ b/generate-bundle.py @@ -11,12 +11,11 @@ zip.extract("upx-4.2.3-win32/upx.exe", path=os.getcwd()) shutil.move("upx-4.2.3-win32/upx.exe", os.path.join(os.getcwd(), "upx.exe")) os.mkdir("dist") -with open("utils.py", "r", encoding="utf8") as util: - util_context = util.read() for file in os.listdir(os.getcwd()): if file != "utils.py" and file != "generate-bundle.py" and file.endswith(".py") and not os.path.isdir(file): print(f"build {file}", flush=True) - PyInstaller.__main__.run(["-F", file, "--optimize", "2", "-i", "favicon.ico"]) + PyInstaller.__main__.run(["-F", file, "--optimize", "2", "-i", "favicon.ico", "--exclude-module", + "charset_normalizer,_ctypes,_decimal,_hashlib,_bz2,_lzma,pyexpat", ]) # 傻逼 # 狗屎代碼 diff --git a/utils.py b/utils.py index 58cc5e9..5b05c66 100644 --- a/utils.py +++ b/utils.py @@ -5,7 +5,10 @@ import tqdm import yaml import traceback -from yaml import CLoader as Loader, CDumper as Dumper +from yaml import CLoader as Loader +import warnings + +warnings.filterwarnings("ignore") def script_license():