Python SystemError Exception
Example
Raise a SystemError, and handle it:
try:
raise SystemError("Something went wrong inside Python")
except SystemError as e:
print("Error:", e)
Try it Yourself »
Definition and Usage
The SystemError exception occurs when Python finds an internal error in itself.
You should not see it in normal programs. If you do, it is usually a bug in Python, or in a module that is written in C, and it should be reported to the people who made it.
The example raises it with raise, to show how it can be handled.
Related Pages
Read more about handling errors in our Python Try Except Tutorial.