You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Adjust ann_assign_init rule...
We've reduced spurious `sstmt` reductions. The `ann_assign_init` rule needs to adjust accordingly.
This commit is contained in:
@@ -414,10 +414,9 @@ class TreeTransform(GenericASTTraversal, object):
|
||||
prev = node[0][0]
|
||||
new_stmts = [node[0]]
|
||||
for i, sstmt in enumerate(node[1:]):
|
||||
ann_assign = sstmt[0][0]
|
||||
ann_assign = sstmt[0]
|
||||
if (
|
||||
sstmt[0] == "stmt"
|
||||
and ann_assign == "ann_assign"
|
||||
ann_assign == "ann_assign"
|
||||
and prev == "assign"
|
||||
):
|
||||
annotate_var = ann_assign[-2]
|
||||
@@ -426,7 +425,7 @@ class TreeTransform(GenericASTTraversal, object):
|
||||
sstmt[0][0] = SyntaxTree(
|
||||
"ann_assign_init", [ann_assign[0], prev[0], annotate_var]
|
||||
)
|
||||
sstmt[0][0].transformed_by = "n_stmts"
|
||||
sstmt[0].transformed_by = "n_stmts"
|
||||
pass
|
||||
pass
|
||||
new_stmts.append(sstmt)
|
||||
|
@@ -10,6 +10,8 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# This file is suitable for sourcing inside POSIX shell as
|
||||
# well as importing into Python
|
||||
# well as importing into Python. That's why there is no
|
||||
# space around "=" below.
|
||||
VERSION="3.7.4" # noqa
|
||||
|
Reference in New Issue
Block a user