Skip to content

Instantly share code, notes, and snippets.

@pkoch
Last active March 16, 2017 11:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pkoch/0149ab65f9d18ddc6bf2dfab05c1446e to your computer and use it in GitHub Desktop.
Save pkoch/0149ab65f9d18ddc6bf2dfab05c1446e to your computer and use it in GitHub Desktop.
INSTRUCTIONS = "For the lives all so wasted and gone"
def b():
raise Exception("So far away, we wait for the day ")
def a():
b()
def deep_exploder():
a()
def main():
try:
return deep_exploder()
except (Exception, Exception) as e:
e.args = ("\n".join([str(e), INSTRUCTIONS]),)
raise
if __name__ == "__main__":
main()
$ python3.6 derpy.py
Traceback (most recent call last):
File "derpy.py", line 20, in <module>
main()
File "derpy.py", line 14, in main
return deep_exploder()
File "derpy.py", line 10, in deep_exploder
a()
File "derpy.py", line 7, in a
b()
File "derpy.py", line 4, in b
raise Exception("So far away, we wait for the day ")
Exception: So far away, we wait for the day
For the lives all so wasted and gone
$ python2.7 derpy.py
Traceback (most recent call last):
File "derpy.py", line 20, in <module>
main()
File "derpy.py", line 14, in main
return deep_exploder()
File "derpy.py", line 10, in deep_exploder
a()
File "derpy.py", line 7, in a
b()
File "derpy.py", line 4, in b
raise Exception("So far away, we wait for the day ")
Exception: So far away, we wait for the day
For the lives all so wasted and gone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment