Search code examples
pythonexceptionraise

What is the point of using bare raise in Python


I am trying to understand this code and the use of the following pattern:

try: 
  ...
except Exception:
  raise

What is the point of re-raising the exception like this? Don't you get the same result if you remove the whole try-except block?


Solution

  • Yes, that code achieves nothing.