Merge branch 'python-3.3-to-3.5' into python-2.4

This commit is contained in:
rocky
2022-09-30 03:42:00 -04:00
3 changed files with 13 additions and 4 deletions

Binary file not shown.

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2019-2021 by Rocky Bernstein
# Copyright (c) 2019-2022 by Rocky Bernstein
#
# 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
@@ -32,6 +32,7 @@ from uncompyle6.semantics.helper import (
find_none,
zip_longest
)
from uncompyle6.show import maybe_show_tree_param_default
@@ -248,7 +249,9 @@ def make_function36(self, node, is_lambda, nested=1, code_node=None):
self.write(", ")
ends_in_comma = True
ann_dict = kw_dict = default_tup = None
# ann_dict = kw_dict = default_tup = None
kw_dict = None
fn_bits = node[-1].attr
# Skip over:
# MAKE_FUNCTION,

View File

@@ -233,7 +233,10 @@ class NonterminalActions:
assert len(keys) == len(flat_elems) - 1
for i, elem in enumerate(flat_elems[:-1]):
assert elem.kind == "ADD_VALUE"
value = elem.pattr
try:
value = "%r" % elem.pattr
except Exception:
value = elem.pattr
if elem.linestart is not None:
if elem.linestart != self.line_number:
next_indent = self.indent + INDENT_PER_LEVEL[:-1]
@@ -255,7 +258,10 @@ class NonterminalActions:
else:
for elem in flat_elems:
assert elem.kind == "ADD_VALUE"
value = elem.pattr
try:
value = "%r" % elem.pattr
except Exception:
value = elem.pattr
if elem.linestart is not None:
if elem.linestart != self.line_number:
next_indent = self.indent + INDENT_PER_LEVEL[:-1]