Closed
Description
To reproduce, run
import sys
import uncompyle6
for i in range(2):
pass
uncompyle6.deparse_code2str(code=sys._getframe().f_code, out=sys.stdout)
which gives:
Instruction context:
8 30 LOAD_NAME uncompyle6
32 LOAD_ATTR deparse_code2str
34 LOAD_NAME sys
36 LOAD_METHOD _getframe
38 CALL_METHOD_0 0 ''
40 LOAD_ATTR f_code
42 LOAD_NAME sys
44 LOAD_ATTR stdout
46 LOAD_CONST ('code', 'out')
-> 48 CALL_FUNCTION_KW_2 2 ''
Traceback (most recent call last):
File "/Users/laike9m/.pyenv/versions/3.8.0/envs/Cyberbrain@3.8.0/src/uncompyle6/uncompyle6/semantics/pysource.py", line 2434, in build_ast
ast = python_parser.parse(self.p, tokens, customize)
File "/Users/laike9m/.pyenv/versions/3.8.0/envs/Cyberbrain@3.8.0/src/uncompyle6/uncompyle6/parser.py", line 605, in parse
ast = p.parse(tokens)
File "/Users/laike9m/.pyenv/versions/Cyberbrain@3.8.0/lib/python3.8/site-packages/spark_parser/spark.py", line 501, in parse
self.error(tokens, i-1)
File "/Users/laike9m/.pyenv/versions/3.8.0/envs/Cyberbrain@3.8.0/src/uncompyle6/uncompyle6/parser.py", line 191, in error
raise ParserError(err_token, err_token.offset)
uncompyle6.parser.ParserError: Parse error at or near `CALL_FUNCTION_KW_2' instruction at offset 48
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "uncompile.py", line 8, in <module>
uncompyle6.deparse_code2str(code=sys._getframe().f_code, out=sys.stdout)
File "/Users/laike9m/.pyenv/versions/3.8.0/envs/Cyberbrain@3.8.0/src/uncompyle6/uncompyle6/semantics/pysource.py", line 2582, in deparse_code2str
return code_deparse(
File "/Users/laike9m/.pyenv/versions/3.8.0/envs/Cyberbrain@3.8.0/src/uncompyle6/uncompyle6/semantics/pysource.py", line 2504, in code_deparse
deparsed.ast = deparsed.build_ast(tokens, customize, isTopLevel=isTopLevel)
File "/Users/laike9m/.pyenv/versions/3.8.0/envs/Cyberbrain@3.8.0/src/uncompyle6/uncompyle6/semantics/pysource.py", line 2437, in build_ast
raise ParserError(e, tokens)
uncompyle6.semantics.parser_error.ParserError: --- This code section failed: ---
1 0 LOAD_CONST 0
2 LOAD_CONST None
4 IMPORT_NAME sys
6 STORE_NAME sys
2 8 LOAD_CONST 0
10 LOAD_CONST None
12 IMPORT_NAME uncompyle6
14 STORE_NAME uncompyle6
5 16 LOAD_NAME range
18 LOAD_CONST 2
20 CALL_FUNCTION_1 1 ''
22 GET_ITER
24 FOR_ITER 30 'to 30'
26 STORE_NAME i
6 28 CONTINUE 24 'to 24'
8 30 LOAD_NAME uncompyle6
32 LOAD_ATTR deparse_code2str
34 LOAD_NAME sys
36 LOAD_METHOD _getframe
38 CALL_METHOD_0 0 ''
40 LOAD_ATTR f_code
42 LOAD_NAME sys
44 LOAD_ATTR stdout
46 LOAD_CONST ('code', 'out')
48 CALL_FUNCTION_KW_2 2 ''
50 POP_TOP
Parse error at or near `CALL_FUNCTION_KW_2' instruction at offset 48
Python version 3.8.0, uncompyle6 version 3.5.0
Metadata
Metadata
Assignees
Labels
No labels