You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
Remove messed-up show_tree call
This commit is contained in:
@@ -17,22 +17,21 @@ All the crazy things we have to do to handle Python functions in 3.6 and above.
|
|||||||
The saga of changes before 3.6 is in other files.
|
The saga of changes before 3.6 is in other files.
|
||||||
"""
|
"""
|
||||||
from xdis import (
|
from xdis import (
|
||||||
iscode,
|
CO_ASYNC_GENERATOR,
|
||||||
|
CO_GENERATOR,
|
||||||
code_has_star_arg,
|
code_has_star_arg,
|
||||||
code_has_star_star_arg,
|
code_has_star_star_arg,
|
||||||
CO_GENERATOR,
|
iscode,
|
||||||
CO_ASYNC_GENERATOR,
|
|
||||||
)
|
)
|
||||||
from uncompyle6.scanner import Code
|
|
||||||
from uncompyle6.semantics.parser_error import ParserError
|
|
||||||
from uncompyle6.parser import ParserError as ParserError2
|
from uncompyle6.parser import ParserError as ParserError2
|
||||||
|
from uncompyle6.scanner import Code
|
||||||
from uncompyle6.semantics.helper import (
|
from uncompyle6.semantics.helper import (
|
||||||
find_all_globals,
|
find_all_globals,
|
||||||
find_globals_and_nonlocals,
|
find_globals_and_nonlocals,
|
||||||
find_none,
|
find_none,
|
||||||
)
|
)
|
||||||
|
from uncompyle6.semantics.parser_error import ParserError
|
||||||
from uncompyle6.show import maybe_show_tree_param_default
|
|
||||||
|
|
||||||
|
|
||||||
def make_function36(self, node, is_lambda, nested=1, code_node=None):
|
def make_function36(self, node, is_lambda, nested=1, code_node=None):
|
||||||
@@ -55,7 +54,6 @@ def make_function36(self, node, is_lambda, nested=1, code_node=None):
|
|||||||
- handle format tuple parameters
|
- handle format tuple parameters
|
||||||
"""
|
"""
|
||||||
value = default
|
value = default
|
||||||
maybe_show_tree_param_default(self.showast, name, value)
|
|
||||||
if annotation:
|
if annotation:
|
||||||
result = "%s: %s=%s" % (name, annotation, value)
|
result = "%s: %s=%s" % (name, annotation, value)
|
||||||
else:
|
else:
|
||||||
@@ -150,7 +148,7 @@ def make_function36(self, node, is_lambda, nested=1, code_node=None):
|
|||||||
kwonlyargcount = code.co_kwonlyargcount
|
kwonlyargcount = code.co_kwonlyargcount
|
||||||
|
|
||||||
paramnames = list(scanner_code.co_varnames[:argc])
|
paramnames = list(scanner_code.co_varnames[:argc])
|
||||||
kwargs = list(scanner_code.co_varnames[argc: argc + kwonlyargcount])
|
kwargs = list(scanner_code.co_varnames[argc : argc + kwonlyargcount])
|
||||||
|
|
||||||
paramnames.reverse()
|
paramnames.reverse()
|
||||||
defparams.reverse()
|
defparams.reverse()
|
||||||
@@ -181,7 +179,7 @@ def make_function36(self, node, is_lambda, nested=1, code_node=None):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
for param in paramnames[i + 1:]:
|
for param in paramnames[i + 1 :]:
|
||||||
if param in annotate_dict:
|
if param in annotate_dict:
|
||||||
params.append("%s: %s" % (param, annotate_dict[param]))
|
params.append("%s: %s" % (param, annotate_dict[param]))
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user