I am searching for a way to change the printable output of an Exception to a silly message in order to learn more about python internals (and mess with a friend ;), so far without success. Consider the following code The code shall output name ‘x’ is not defined I would like the change that output to the name ‘x’