Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #50 #51

Merged
merged 2 commits into from
Jul 21, 2023
Merged

fix #50 #51

merged 2 commits into from
Jul 21, 2023

Conversation

myd7349
Copy link
Contributor

@myd7349 myd7349 commented Jul 17, 2023

本 PR 试图解决 #50

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

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

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

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

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

SystemExit inherits from BaseException instead of Exception.
If PyStand.exe is attached to a console, then show error message in the console.
@myd7349
Copy link
Contributor Author

myd7349 commented Jul 20, 2023

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

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

@myd7349
Copy link
Contributor Author

myd7349 commented Jul 20, 2023

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

@skywind3000
Copy link
Owner

thanks

@skywind3000 skywind3000 merged commit b70a575 into skywind3000:master Jul 21, 2023
9 checks passed
@myd7349 myd7349 deleted the fix-issue-50 branch July 22, 2023 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants