TypeError:exceptions must be old-style classes or derived from BaseException, not str

The sole argument to raise indicates the exception to be raised. This must be either an exception instance or an exception class (a class that derives from Exception).

Try this:

test="abc"
if True:
    raise Exception(test + 'def')

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)