Skip to content

Instantly share code, notes, and snippets.

@snim2
Created September 24, 2009 15:01
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 snim2/192782 to your computer and use it in GitHub Desktop.
Save snim2/192782 to your computer and use it in GitHub Desktop.
Using the Python disassembler to analyse uncaught exceptions
>>> import dis
>>> 1 / 0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ZeroDivisionError: integer division or modulo by zero
>>> dis.dis()
1 0 LOAD_CONST 0 (1)
3 LOAD_CONST 1 (0)
--> 6 BINARY_DIVIDE
7 PRINT_EXPR
8 LOAD_CONST 2 (None)
11 RETURN_VALUE
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment