python2 try except raise, TypeError: exceptions must be old-style classes or derived from BaseExcept

Опубликовано: 20 Октябрь 2020
на канале: gocha's learning space
39
0

Traceback (most recent call last):
File "./ExceptionHandling_7_raise.py", line 11, in module
myfunc(int(my_input))
File "./ExceptionHandling_7_raise.py", line 5, in myfunc
raise "Invalid level", level
TypeError: exceptions must be old-style classes or derived from BaseException, not str