MySQL queries with try-except error handling
If you're just going to re-raise the exception you caught, then there is no point in catching it in the first place. Instead of:

try:
    code block A
except Exception:
    raise
else:
    code block B


you can write:

code block A
code block B


and the behaviour is just the same.