python-3.x - Visual Studio Code Python 调试“发生异常 SystemExit”
问题描述
很长时间以来,我一直在使用 Visual Studio 代码和 Python 扩展。
目前我有 Visual Studio Code 版本 1.27.2、Python 扩展“ms-python.python”版本 2018.8.0、python 版本 3.6.6,由 Windows 10 1803 企业版系统托管。
与过去相比,最新版本的 Code/MS Python 在调试过程中的表现有所不同。
过去,在 Visual Studio Code 中执行以下 Python 代码不会产生任何异常:
# Import exit from sys
from sys import exit as sys_exit
# Exit to system with errorlevel set to 1
sys_exit(1)
# Next instruction is never executed.
# Executing the script directly from the terminal in Windows sets the
# errorlevel to 1 and the script execution is terminated.
print('unreachable code')
现在结果是执行 sys_exit(1) 指令时出现 SystemExit 异常(VSCode 截图)。
问题:有没有办法禁用此行为并返回上一个行为?
解决方案
推荐阅读
- python - 如何对作为字典值的列表进行排序?
- node-red - 多个输入节点红色函数python
- c - sprintf 组合字符数组
- python - 如何在最后一步之前保存我的表单向导?
- java - 处理错误:InvalidGrantException,错误凭据
- ios - 当 prefersLargeTitles 为 true 时自定义 NavigatioItem TitleView
- spring - intellij 中的简单 hello spring 演示不工作错误 http 状态 500
- server - Lua 服务器客户端聊天示例
- javascript - 提交表单不做任何事情
- c# - 如何使用 C# 将多重身份验证登录到 Dynamics 365