You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 08:49:51 +08:00
Compare commits
11 Commits
release-py
...
3.6.7
Author | SHA1 | Date | |
---|---|---|---|
|
a4eaeea5b2 | ||
|
1141dfefc2 | ||
|
302a5d53d4 | ||
|
698a3073d0 | ||
|
e6adf822cc | ||
|
8c5acef792 | ||
|
7578253f7d | ||
|
9e193fd7cb | ||
|
ab6b12be56 | ||
|
5bd97aa756 | ||
|
5237d704fa |
@@ -36,7 +36,6 @@ jobs:
|
||||
# fallback to using the latest cache if no exact match is found
|
||||
- v2-dependencies-
|
||||
|
||||
# This is based on your 1.0 configuration file or project settings
|
||||
- run: pip install --user --upgrade setuptools
|
||||
- run: pip install --user -e .
|
||||
- run: pip install --user -r requirements-dev.txt
|
||||
|
5
NEWS.md
5
NEWS.md
@@ -1,3 +1,8 @@
|
||||
3.6.7: 2020-4-27 xdis again
|
||||
===========================
|
||||
|
||||
More upheaval in xdis which we need to track here.
|
||||
|
||||
3.6.6: 2020-4-20 Love in the time of Cholera
|
||||
============================================
|
||||
|
||||
|
@@ -58,7 +58,7 @@ entry_points = {
|
||||
]}
|
||||
ftp_url = None
|
||||
install_requires = ["spark-parser >= 1.8.9, < 1.9.0",
|
||||
"xdis >= 4.4.0, < 4.5.0"]
|
||||
"xdis >= 4.5.1, < 4.6.0"]
|
||||
|
||||
license = "GPL3"
|
||||
mailing_list = "python-debugger@googlegroups.com"
|
||||
|
@@ -5,4 +5,4 @@ if [[ $0 == ${BASH_SOURCE[0]} ]] ; then
|
||||
echo "This script should be *sourced* rather than run directly through bash"
|
||||
exit 1
|
||||
fi
|
||||
export PYVERSIONS='3.5.9 3.6.10 2.6.9 3.3.7 2.7.17 3.2.6 3.1.5 3.4.10 3.7.7 3.8.2'
|
||||
export PYVERSIONS='3.5.9 3.6.10 2.6.9 3.3.7 2.7.18 3.2.6 3.1.5 3.4.10 3.7.7 3.8.2'
|
||||
|
@@ -53,6 +53,7 @@ install:
|
||||
# compiled extensions and are not provided as pre-built wheel packages,
|
||||
# pip will build them from source using the MSVC compiler matching the
|
||||
# target Python version and architecture
|
||||
- "%CMD_IN_ENV% pip install git+git://github.com/rocky/python-uncompyle6.git#egg=uncompyle6-3.6.6"
|
||||
- "%CMD_IN_ENV% pip install -r requirements.txt"
|
||||
|
||||
build_script:
|
||||
|
@@ -30,7 +30,7 @@ from uncompyle6.show import maybe_show_asm
|
||||
|
||||
|
||||
class ParserError(Exception):
|
||||
def __init__(self, token, offset, debug):
|
||||
def __init__(self, token, offset, debug=PARSER_DEFAULT_DEBUG):
|
||||
self.token = token
|
||||
self.offset = offset
|
||||
self.debug = debug
|
||||
|
@@ -2,10 +2,10 @@
|
||||
"""
|
||||
Python 3.7 base code. We keep non-custom-generated grammar rules out of this file.
|
||||
"""
|
||||
from uncompyle6.scanners.tok import Token
|
||||
from uncompyle6.parser import ParserError, PythonParser, PythonParserSingle, nop_func
|
||||
from uncompyle6.parser import ParserError, PythonParser, nop_func
|
||||
from uncompyle6.parsers.treenode import SyntaxTree
|
||||
from spark_parser import DEFAULT_DEBUG as PARSER_DEFAULT_DEBUG
|
||||
from spark_parser.spark import rule2str
|
||||
|
||||
from uncompyle6.parsers.reducecheck import (
|
||||
and_check,
|
||||
@@ -1182,18 +1182,27 @@ class Python37BaseParser(PythonParser):
|
||||
def reduce_is_invalid(self, rule, ast, tokens, first, last):
|
||||
lhs = rule[0]
|
||||
n = len(tokens)
|
||||
last = min(last, n-1)
|
||||
last = min(last, n - 1)
|
||||
fn = self.reduce_check_table.get(lhs, None)
|
||||
try:
|
||||
if fn:
|
||||
return fn(self, lhs, n, rule, ast, tokens, first, last)
|
||||
except:
|
||||
import sys, traceback
|
||||
print("Exception in %s %s\n" +
|
||||
"rule: %s\n" +
|
||||
"offsets %s .. %s" %
|
||||
(fn.__name__, sys.exc_info()[1], rule, tokens[first].offset, tokens[last].offset))
|
||||
print(traceback.print_tb(sys.exc_info()[2],-1))
|
||||
|
||||
print(
|
||||
("Exception in %s %s\n"
|
||||
+ "rule: %s\n"
|
||||
+ "offsets %s .. %s")
|
||||
% (
|
||||
fn.__name__,
|
||||
sys.exc_info()[1],
|
||||
rule2str(rule),
|
||||
tokens[first].offset,
|
||||
tokens[last].offset,
|
||||
)
|
||||
)
|
||||
print(traceback.print_tb(sys.exc_info()[2], -1))
|
||||
raise ParserError(tokens[last], tokens[last].off2int(), self.debug["rules"])
|
||||
|
||||
if lhs in ("aug_assign1", "aug_assign2") and ast[0][0] == "and":
|
||||
|
@@ -8,9 +8,6 @@ def or_check(self, lhs, n, rule, ast, tokens, first, last):
|
||||
# for t in range(first, last): print(tokens[t])
|
||||
# print("="*40)
|
||||
|
||||
if (first, last) == (2, 6):
|
||||
from trepan.api import debug; debug()
|
||||
|
||||
if rhs[0:2] in (("expr_jt", "expr"),
|
||||
("expr_jitop", "expr"),
|
||||
("expr_jit", "expr")):
|
||||
|
@@ -1163,6 +1163,7 @@ class FragmentsWalker(pysource.SourceWalker, object):
|
||||
# modularity is broken here
|
||||
p_insts = self.p.insts
|
||||
self.p.insts = self.scanner.insts
|
||||
self.p.offset2inst_index = self.scanner.offset2inst_index
|
||||
ast = python_parser.parse(self.p, tokens, customize)
|
||||
self.p.insts = p_insts
|
||||
except (python_parser.ParserError, AssertionError) as e:
|
||||
@@ -1200,10 +1201,11 @@ class FragmentsWalker(pysource.SourceWalker, object):
|
||||
# modularity is broken here
|
||||
p_insts = self.p.insts
|
||||
self.p.insts = self.scanner.insts
|
||||
self.p.offset2inst_index = self.scanner.offset2inst_index
|
||||
ast = parser.parse(self.p, tokens, customize)
|
||||
self.p.insts = p_insts
|
||||
except (parser.ParserError, AssertionError) as e:
|
||||
raise ParserError(e, tokens)
|
||||
raise ParserError(e, tokens, {})
|
||||
|
||||
maybe_show_tree(self, ast)
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# (C) Copyright 2015-2018 by Rocky Bernstein
|
||||
# (C) Copyright 2015-2018, 2020 by Rocky Bernstein
|
||||
# (C) Copyright 2000-2002 by hartmut Goebel <h.goebel@crazy-compilers.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
@@ -27,10 +27,8 @@ from subprocess import call
|
||||
import uncompyle6
|
||||
from uncompyle6.scanner import (Token as ScannerToken, get_scanner)
|
||||
from uncompyle6 import PYTHON3
|
||||
from xdis import iscode
|
||||
from xdis import iscode, load_file, load_module, pretty_code_flags
|
||||
from xdis.magics import PYTHON_MAGIC_INT
|
||||
from xdis.load import load_file, load_module
|
||||
from xdis.util import pretty_flags
|
||||
|
||||
# FIXME: DRY
|
||||
if PYTHON3:
|
||||
@@ -352,8 +350,8 @@ def cmp_code_objects(version, is_pypy, code_obj1, code_obj2, verify,
|
||||
flags2 &= ~0x000000a0
|
||||
if flags1 != flags2:
|
||||
raise CmpErrorMember(name, 'co_flags',
|
||||
pretty_flags(flags1),
|
||||
pretty_flags(flags2))
|
||||
pretty_code_flags(flags1),
|
||||
pretty_code_flags(flags2))
|
||||
else:
|
||||
# all other members must be equal
|
||||
if getattr(code_obj1, member) != getattr(code_obj2, member):
|
||||
|
@@ -12,4 +12,4 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# This file is suitable for sourcing inside bash as
|
||||
# well as importing into Python
|
||||
VERSION="3.6.6" # noqa
|
||||
VERSION="3.6.7" # noqa
|
||||
|
Reference in New Issue
Block a user