📜  TypeError:异常必须从 BaseException 派生 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:08.876000             🧑  作者: Mango

代码示例1
#When using raise, it must be given an Exeption class or one that inherits from it.
#e.g.ValueError, IndexError, KeyError
raise ValueError("I'm a fancy error message")