Message155305
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 |
|
Date |
User |
Action |
Args |
2012-03-10 12:27:00 | mark.dickinson | set | recipients:
+ mark.dickinson, terry.reedy, benjamin.peterson, meador.inge, Jim.Jewett, menegazzobr |
2012-03-10 12:27:00 | mark.dickinson | set | messageid: <1331382420.32.0.703363205329.issue14169@psf.upfronthosting.co.za> |
2012-03-10 12:26:59 | mark.dickinson | link | issue14169 messages |
2012-03-10 12:26:59 | mark.dickinson | create | |
|