What does raise in Python raise?

Viewed 15220

Consider the following code:

try:
    raise Exception("a")
except:
    try:
        raise Exception("b")
    finally:
        raise

This will raise Exception: a. I expected it to raise Exception: b (need I explain why?). Why does the final raise raise the original exception rather than (what I thought) was the last exception raised?

2 Answers
Related