Small tweaks

This commit is contained in:
rocky
2018-04-04 22:36:26 -04:00
parent 341e17f62c
commit 30ce3a8bea
3 changed files with 5 additions and 7 deletions

View File

@@ -21,7 +21,6 @@ from uncompyle6.semantics.consts import (
from uncompyle6.parsers.astnode import AST
from uncompyle6.scanners.tok import Token
from uncompyle6.semantics.customize3 import customize_for_version3
def customize_for_version(self, is_pypy, version):
if is_pypy:
@@ -182,5 +181,6 @@ def customize_for_version(self, is_pypy, version):
})
if version >= 3.0:
from uncompyle6.semantics.customize3 import customize_for_version3
customize_for_version3(self, version)
return

View File

@@ -46,8 +46,6 @@ def customize_for_version3(self, version):
self.n_yield_from = n_yield_from
if 3.2 <= version <= 3.4:
# In Python 3.3+ only
def n_call(node):
mapping = self._get_mapping(node)
key = node

View File

@@ -510,9 +510,9 @@ def make_function3(self, node, is_lambda, nested=1, codeNode=None):
args_node = node[-1]
# Get a list of tree nodes that constitute the "default parameters"
# these are default values that appear before any *, and are not
# to be confused with keyword parameters which may appear after *.
# Get a list of tree nodes that constitute the values for the "default
# parameters"; these are default values that appear before any *, and are
# not to be confused with keyword parameters which may appear after *.
if isinstance(args_node.attr, tuple):
pos_args, kw_args, annotate_argc = args_node.attr
# FIXME: there is probably a better way to classify this.
@@ -539,7 +539,7 @@ def make_function3(self, node, is_lambda, nested=1, codeNode=None):
default_values_start += 1
defparams = node[default_values_start:default_values_start+args_node.attr[0]]
else:
# args are first, before kwargs.
# args are first, before kwargs. Or there simply are no kwargs.
defparams = node[:args_node.attr[0]]
pass
else: