O
Ola Natvig
Hi all
Does anybody know why it's not possible to raise Exceptions which are
types (new-style-classes). I know all standard exceptions are classic
classes, but if you make a custom exception which both inherits from a
exception class and a new-style one the it causes a type error when raised.
Traceback (most recent call last):
File "<pyshell#2>", line 1, in -toplevel-
raise b
TypeError: exceptions must be classes, instances, or strings
(deprecated), not type
This is weird, I think. Are there any issues about raising types as
exceptions that I can't think of ?
Does anybody know why it's not possible to raise Exceptions which are
types (new-style-classes). I know all standard exceptions are classic
classes, but if you make a custom exception which both inherits from a
exception class and a new-style one the it causes a type error when raised.
Traceback (most recent call last):
File "<pyshell#2>", line 1, in -toplevel-
raise b
TypeError: exceptions must be classes, instances, or strings
(deprecated), not type
This is weird, I think. Are there any issues about raising types as
exceptions that I can't think of ?