Merge branch 'python-3.3-to-3.5' into python-3.0-to-3.2

This commit is contained in:
rocky
2024-02-25 06:14:44 -05:00
9 changed files with 17 additions and 20 deletions

View File

@@ -1,5 +1,7 @@
#/bin/bash
owd=$(pwd)
cd $(dirname ${BASH_SOURCE[0]})
if . ./setup-python-2.4.sh; then
git merge python-3.0-to-3.2
fi
cd $owd

View File

@@ -1,5 +1,7 @@
#/bin/bash
owd=$(pwd)
cd $(dirname ${BASH_SOURCE[0]})
if . ./setup-python-3.0.sh; then
git merge python-3.3-to-3.5
fi
cd $owd

View File

@@ -1,5 +1,7 @@
#/bin/bash
owd=$(pwd)
cd $(dirname ${BASH_SOURCE[0]})
if . ./setup-python-3.3.sh; then
git merge master
fi
cd $owd

View File

@@ -18,6 +18,7 @@ SKIP_TESTS=(
[test_cd.py]=1 # i# No module cl
[test_cl.py]=1 # it fails on its own
[test_cmath.py]=pytest
[test_codecmaps_cn.py]=1 # it fails on its own
[test_codecmaps_jp.py]=1 # it fails on its own
[test_codecmaps_kr.py]=1 # it fails on its own

View File

@@ -265,7 +265,7 @@ class Scanner3(Scanner):
has_arg=True,
has_extended_arg=False,
opc=self.opc,
optype=None,
optype="pseudo",
)
)
for j in range(collection_start, i):
@@ -292,7 +292,7 @@ class Scanner3(Scanner):
has_arg=t.has_arg,
has_extended_arg=False,
opc=t.opc,
optype=None,
optype="pseudo",
)
)
return new_tokens
@@ -341,7 +341,7 @@ class Scanner3(Scanner):
has_arg=True,
has_extended_arg=False,
opc=self.opc,
optype=None,
optype="pseudo",
)
)
for j in range(collection_start, i, 2):

View File

@@ -89,7 +89,7 @@ class Scanner37(Scanner37Base):
has_arg=True,
has_extended_arg=False,
opc=self.opc,
optype=None,
optype="pseudo",
)
)
for j in range(collection_start, i):

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2015-2021 by Rocky Bernstein
# Copyright (c) 2015-2021 2024 by Rocky Bernstein
# Copyright (c) 2000-2002 by hartmut Goebel <h.goebel@crazy-compilers.com>
#
# This program is free software: you can redistribute it and/or modify
@@ -17,6 +17,7 @@
All the crazy things we have to do to handle Python functions in Python before 3.0.
The saga of changes continues in 3.0 and above and in other files.
"""
from itertools import zip_longest
from xdis import code_has_star_arg, code_has_star_star_arg, iscode
@@ -30,7 +31,6 @@ from uncompyle6.semantics.helper import (
print_docstring,
)
from uncompyle6.semantics.parser_error import ParserError
from uncompyle6.show import maybe_show_tree_param_default
def make_function2(self, node, is_lambda, nested=1, code_node=None):

View File

@@ -1271,7 +1271,7 @@ class SourceWalker(GenericASTTraversal, NonterminalActions, ComprehensionMixin):
transform_tree = self.treeTransform.transform(ast, code)
self.maybe_show_tree(ast, phase="before")
self.maybe_show_tree(transform_tree, phase="after")
del ast # Save memory
return transform_tree

View File

@@ -488,19 +488,9 @@ class TreeTransform(GenericASTTraversal, object):
self.ast[i] = self.ast[i][0]
if is_docstring(self.ast[i], self.version, code.co_consts):
load_const = self.ast[i].first_child()
docstring_ast = SyntaxTree(
"docstring",
[
Token(
"LOAD_STR",
has_arg=True,
offset=0,
attr=load_const.attr,
pattr=load_const.pattr,
)
],
)
load_const = copy(self.ast[i].first_child())
store_name = copy(self.ast[i].last_child())
docstring_ast = SyntaxTree("docstring", [load_const, store_name])
docstring_ast.transformed_by = "transform"
del self.ast[i]
self.ast.insert(0, docstring_ast)