Skip to content

显式捕获 KeyboardInterrupt: #50

@assesvgs

Description

@assesvgs

在 occm_web_launcher.py 中添加

#!/usr/bin/env python3
"""OCCM Web 启动器 — PyInstaller 打包入口"""

import sys
import os

PyInstaller 打包后的路径修正

if getattr(sys, "frozen", False):
_base = sys._MEIPASS # type: ignore[attr-defined]
os.chdir(_base)
sys.path.insert(0, _base)

启动 occm_web 包

try:
from occm_web.main import * # noqa: F401,F403
except KeyboardInterrupt:
# 优雅退出,不显示错误
print("\n[OCCM Web] 已停止")
sys.exit(0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions