TypeError:exceptions必须是旧式类或从BaseException派生,而不是str
发布于 2021-01-29 17:54:42
以下是我的代码:
test = 'abc'
if True:
raise test + 'def'
当我运行它时,它给了我 TypeError
TypeError: exceptions must be old-style classes or derived from BaseException, not str
那么应该test
是哪种类型呢?
关注者
0
被浏览
45
1 个回答