美文网首页
Python2和Python3中raise Exception

Python2和Python3中raise Exception

作者: M_派森 | 来源:发表于2018-04-14 22:37 被阅读43次

    今天写了个记录错误日志的脚本,发现Python3中的raise Exception发生了变化,如下:

    错误

    搜了下才知道原来是Python3.6已经不支持这种写法了,所以用了新的方式,如下:

    正确

    相关文章

      网友评论

          本文标题:Python2和Python3中raise Exception

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