You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
Improve Python 1.4 bytecode coverage
This commit is contained in:
BIN
test/bytecode_1.4/01_print-1.4.pyc
Normal file
BIN
test/bytecode_1.4/01_print-1.4.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
test/bytecode_1.4/test_empty.pyc
Normal file
BIN
test/bytecode_1.4/test_empty.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_1.4/test_exec.pyc
Normal file
BIN
test/bytecode_1.4/test_exec.pyc
Normal file
Binary file not shown.
Binary file not shown.
5
test/simple_source/bug14/01_print.py
Normal file
5
test/simple_source/bug14/01_print.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# Python 1.4 aifc.py
|
||||
def _readmark(self, markers):
|
||||
if self._markers: print 'marker',
|
||||
else: print 'markers',
|
||||
print 'instead of', markers
|
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
"""byte compiles a Python program after version 2.2 or so. Also see compile_file_1x.py"""
|
||||
import sys
|
||||
if len(sys.argv) != 2:
|
||||
print("Usage: compile-file.py *python-file*")
|
||||
|
22
test/stdlib/compile_file_1x.py
Executable file
22
test/stdlib/compile_file_1x.py
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python
|
||||
"""byte compiles a Python 1.x program"""
|
||||
import sys
|
||||
if len(sys.argv) != 2:
|
||||
print("Usage: compile-file.py *python-file*")
|
||||
sys.exit(1)
|
||||
source = sys.argv[1]
|
||||
|
||||
# assert source.endswith('.py')
|
||||
basename = source[:-3]
|
||||
|
||||
# We do this crazy way to support Python 1.4 which
|
||||
# doesn't support version_info.
|
||||
PY_VERSION = sys.version[:3]
|
||||
|
||||
bytecode = "%s-%s.pyc" % (basename, PY_VERSION)
|
||||
|
||||
import py_compile
|
||||
print("# compiling %s to %s" % (source, bytecode))
|
||||
py_compile.compile(source, bytecode)
|
||||
# import os
|
||||
# os.system("../bin/uncompyle6 %s" % bytecode)
|
@@ -23,6 +23,8 @@ class Python14Parser(Python15Parser):
|
||||
jb_pop14
|
||||
POP_BLOCK else_suitel COME_FROM
|
||||
|
||||
print_items_nl_stmt ::= expr PRINT_ITEM_CONT print_items_opt PRINT_NEWLINE_CONT
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, debug_parser=PARSER_DEFAULT_DEBUG):
|
||||
|
@@ -32,5 +32,5 @@ class Scanner14(scan.Scanner15):
|
||||
|
||||
# # for t in tokens:
|
||||
# # print(t)
|
||||
|
||||
return tokens, customize
|
||||
#
|
||||
# return tokens, customize
|
||||
|
Reference in New Issue
Block a user