You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 09:22:40 +08:00
Merge branch 'python-3.0-to-3.2' into python-2.4
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2018-2022 Rocky Bernstein <rocky@gnu.org>
|
||||
# Copyright (C) 2018-2023 Rocky Bernstein <rocky@gnu.org>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -12,24 +12,24 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
import datetime, os, py_compile, subprocess, sys
|
||||
|
||||
import datetime
|
||||
import os
|
||||
import py_compile
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from xdis import iscode
|
||||
from xdis.load import load_module
|
||||
from xdis.version_info import IS_PYPY, PYTHON_VERSION_TRIPLE, version_tuple_to_str
|
||||
|
||||
from uncompyle6.code_fns import check_object_path
|
||||
from uncompyle6.semantics import pysource
|
||||
from uncompyle6.semantics.pysource import PARSER_DEFAULT_DEBUG
|
||||
from uncompyle6.parser import ParserError
|
||||
from uncompyle6 import verify
|
||||
from uncompyle6.version import __version__
|
||||
|
||||
# from uncompyle6.linenumbers import line_number_mapping
|
||||
|
||||
from uncompyle6.semantics.pysource import code_deparse
|
||||
from uncompyle6.semantics.fragments import code_deparse as code_deparse_fragments
|
||||
from uncompyle6.semantics.linemap import deparse_code_with_map
|
||||
|
||||
from xdis.load import load_module
|
||||
|
||||
def _get_outstream(outfile):
|
||||
dir = os.path.dirname(outfile)
|
||||
@@ -53,7 +53,7 @@ def decompile(
|
||||
source_encoding=None,
|
||||
code_objects={},
|
||||
source_size=None,
|
||||
is_pypy=None,
|
||||
is_pypy=False,
|
||||
magic_int=None,
|
||||
mapstream=None,
|
||||
do_fragments=False,
|
||||
@@ -161,8 +161,8 @@ def decompile(
|
||||
out,
|
||||
bytecode_version,
|
||||
debug_opts=debug_opts,
|
||||
is_pypy=is_pypy,
|
||||
compile_mode=compile_mode,
|
||||
is_pypy=is_pypy,
|
||||
)
|
||||
pass
|
||||
return deparsed
|
||||
@@ -204,7 +204,7 @@ def decompile_file(
|
||||
|
||||
filename = check_object_path(filename)
|
||||
code_objects = {}
|
||||
(version, timestamp, magic_int, co, is_pypy, source_size, sip_hash) = load_module(
|
||||
version, timestamp, magic_int, co, is_pypy, source_size, _ = load_module(
|
||||
filename, code_objects
|
||||
)
|
||||
|
||||
@@ -457,14 +457,14 @@ def main(
|
||||
try:
|
||||
# FIXME: Something is weird with Pypy here
|
||||
sys.stdout.flush()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
if current_outfile:
|
||||
sys.stdout.write("\n")
|
||||
try:
|
||||
# FIXME: Something is weird with Pypy here
|
||||
sys.stdout.flush()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
pass
|
||||
return (tot_files, okay_files, failed_files, verify_failed_files)
|
||||
@@ -480,7 +480,6 @@ if sys.platform.startswith("linux") and os.uname()[2][:2] in ["2.", "3.", "4."]:
|
||||
mi.close()
|
||||
return int(mu) / 1000000
|
||||
|
||||
|
||||
else:
|
||||
|
||||
def __memUsage():
|
||||
|
Reference in New Issue
Block a user