Mark Dickinson <dicki...@gmail.com> added the comment:

Interestingly, dis.dis also fails to decompile the .pyc bytecode generated by 
importing the file.  (This was after adding dummy AddUnit, MakeCustomaryToBase 
and MakeBaseToCustomary definitions to the top of the file to prevent the 
import raising an exception.)


>>> with open('small_with_error.pyc', 'r') as f:
...     bytecode = f.read()
... 
>>> bytecode = bytecode[8:]
>>> dis.dis(bytecode)

<... lots of output snipped ...>

       65686 LOAD_GLOBAL         4 (4)
       65689 STOP_CODE      
       65690 STOP_CODE      
       65691 POP_JUMP_IF_TRUE 27749
       65694 BUILD_TUPLE      1140
       65697 STOP_CODE      
       65698 STOP_CODE      
       65699 STOP_CODE      
       65700 STORE_GLOBAL    26482 (26482)
       65703 POP_JUMP_IF_TRUE  1652
       65706 STOP_CODE      
       65707 STOP_CODE      
       65708 STOP_CODE      
       65709 COMPARE_OP      24951
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File 
"/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/dis.py", line 
45, in dis
    disassemble_string(x)
  File 
"/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/dis.py", line 
147, in disassemble_string
    print '(' + cmp_op[oparg] + ')',
IndexError: tuple index out of range

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14169>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to