美文网首页
Python 异常处理

Python 异常处理

作者: 空口言_1d2e | 来源:发表于2019-07-10 12:04 被阅读0次

    想捕获所有异常时,也不应该用什么类型都不加的 except:,而应该用 except Exception:。前者等价于 except BaseException:,会额外捕获诸如 SystemExit、KeyboardInterrupt 等异常,导致程序无法通过 Ctrl-C 退出。
    Python 异常处理

    相关文章

      网友评论

          本文标题:Python 异常处理

          本文链接:https://www.haomeiwen.com/subject/irdckctx.html