What happens to my first exception (A) when the second (B) is raised in the following code?
A
B
class A(Exception): pass class B(Except
Answering to question 3, you can use:
raise B('second') from None
Which will remove the exception A traceback.
Traceback (most recent call last): File "raising_more_exceptions.py", line 8, in raise B('second') __main__.B: second