You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Merge branch 'master' into python-2.4
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from uncompyle6 import uncompyle
|
||||
from uncompyle6.main import decompile
|
||||
from xdis.magics import sysinfo2float
|
||||
import sys, inspect
|
||||
|
||||
def uncompyle_test():
|
||||
frame = inspect.currentframe()
|
||||
try:
|
||||
co = frame.f_code
|
||||
uncompyle(2.7, co, sys.stdout, 1, 1)
|
||||
decompile(sysinfo2float(), co, sys.stdout, 1, 1)
|
||||
print()
|
||||
finally:
|
||||
del frame
|
||||
|
@@ -17,6 +17,7 @@ import datetime, os, subprocess, sys
|
||||
|
||||
from uncompyle6 import verify, IS_PYPY
|
||||
from xdis.code import iscode
|
||||
from xdis.magics import sysinfo2float
|
||||
from uncompyle6.disas import check_object_path
|
||||
from uncompyle6.semantics import pysource
|
||||
from uncompyle6.parser import ParserError
|
||||
@@ -48,8 +49,14 @@ def decompile(
|
||||
"""
|
||||
ingests and deparses a given code block 'co'
|
||||
|
||||
if `bytecode_version` is None, use the current Python intepreter
|
||||
version.
|
||||
|
||||
Caller is responsible for closing `out` and `mapstream`
|
||||
"""
|
||||
if bytecode_version is None:
|
||||
bytecode_version = sysinfo2float()
|
||||
|
||||
# store final output stream for case of error
|
||||
real_out = out or sys.stdout
|
||||
|
||||
|
Reference in New Issue
Block a user