You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Small tweaks
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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:
|
||||
|
Reference in New Issue
Block a user