Skip to content

Commit 22f2a56

Browse files
committed
修复构建错误 打包 pi win
1 parent 89754b8 commit 22f2a56

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

build_nuitka.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,18 @@ def main():
199199

200200
# 执行打包
201201
try:
202-
subprocess.run(cmd, check=True, cwd=PROJECT_ROOT)
202+
result = subprocess.run(cmd, check=True, cwd=PROJECT_ROOT, capture_output=True, text=True, encoding='utf-8')
203203
print("\n" + "=" * 60)
204204
print("打包成功!")
205205
print("=" * 60)
206206
except subprocess.CalledProcessError as e:
207207
print("\n" + "=" * 60)
208208
print(f"打包失败: {e}")
209+
print(f"返回码: {e.returncode}")
210+
if e.stdout:
211+
print(f"标准输出:\n{e.stdout}")
212+
if e.stderr:
213+
print(f"错误输出:\n{e.stderr}")
209214
print("=" * 60)
210215
sys.exit(1)
211216

build_pyinstaller.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,19 @@ def main():
7171

7272
# 执行打包
7373
try:
74-
subprocess.run(cmd, check=True, cwd=PROJECT_ROOT)
74+
result = subprocess.run(cmd, check=True, cwd=PROJECT_ROOT, capture_output=True, text=True, encoding='utf-8')
7575
print("\n" + "=" * 60)
7676
print("打包成功!")
7777
print("可执行文件位于: dist/SecRandom.exe")
7878
print("=" * 60)
7979
except subprocess.CalledProcessError as e:
8080
print("\n" + "=" * 60)
8181
print(f"打包失败: {e}")
82+
print(f"返回码: {e.returncode}")
83+
if e.stdout:
84+
print(f"标准输出:\n{e.stdout}")
85+
if e.stderr:
86+
print(f"错误输出:\n{e.stderr}")
8287
print("=" * 60)
8388
sys.exit(1)
8489

0 commit comments

Comments
 (0)