Python 3.6+ specialization

This commit is contained in:
rocky
2021-11-03 02:23:19 -04:00
parent 6af63deaa3
commit f6f0e344d0
12 changed files with 47 additions and 131 deletions

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2019-2020 by Rocky Bernstein
# Copyright (c) 2019-2021 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
@@ -31,12 +31,7 @@ from uncompyle6.semantics.helper import (
find_globals_and_nonlocals,
find_none,
)
from xdis.version_info import PYTHON3
if PYTHON3:
from itertools import zip_longest
else:
from itertools import izip_longest as zip_longest
from itertools import zip_longest
from uncompyle6.show import maybe_show_tree_param_default
@@ -266,13 +261,14 @@ def make_function36(self, node, is_lambda, nested=1, code_node=None):
if fn_bits[-1]:
index -= 1
if fn_bits[-2]:
ann_dict = node[index]
# ann_dict = node[index]
index -= 1
if fn_bits[-3]:
kw_dict = node[index]
index -= 1
if fn_bits[-4]:
default_tup = node[index]
# default_tup = node[index]
pass
if kw_dict == "expr":
kw_dict = kw_dict[0]
@@ -285,7 +281,6 @@ def make_function36(self, node, is_lambda, nested=1, code_node=None):
defaults = [self.traverse(n, indent="") for n in kw_dict[:-2]]
names = eval(self.traverse(kw_dict[-2]))
assert len(defaults) == len(names)
sep = ""
# FIXME: possibly handle line breaks
for i, n in enumerate(names):
idx = kwargs.index(n)