skywind3000 / PyStand

:rocket: Python Standalone Deploy Environment !!
MIT License
736 stars 81 forks source link

fix #50 #51

Closed myd7349 closed 1 year ago

myd7349 commented 1 year ago

本 PR 试图解决 #50。

try:
    # ...
except:
    # ...

也会捕获像 SystemExit 这样的 BaseException。因此,改为:

try:
    # ...
except Exception:
    # ...

以仅捕获用户感兴趣的异常。

参考: Difference between except: and except Exception as e:

myd7349 commented 1 year ago

又新增了一次提交,以供讨论。第二次提交主要解决 #52 中提到的问题:

如果重定向成功,优先通过命令行输出错误信息,而非通过 os.MessageBox。

myd7349 commented 1 year ago

觉得去掉 GUI 模式下的 try...except 是另外一种修改策略。这样就不存在 #50、#52 这样的问题了。

skywind3000 commented 1 year ago

thanks