You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
3.6 function/class prototype fixes..
Had got the order backwards in: class Foo(a=B.c) String defaults in default parameter tuples need to be quoted
This commit is contained in:
Binary file not shown.
@@ -6,3 +6,12 @@ def a85decode(b, *, foldspaces=False, adobe=False, ignorechars=b' \t\n\r\v'):
|
|||||||
_UNSET = object()
|
_UNSET = object()
|
||||||
def get(self, section, option, *, raw=False, vars=None, fallback=_UNSET):
|
def get(self, section, option, *, raw=False, vars=None, fallback=_UNSET):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# From 3.6 compileall.py Bug is making default values are in quotes
|
||||||
|
def compile_command(source, filename="<input>", symbol="single"):
|
||||||
|
return
|
||||||
|
|
||||||
|
# From 3.6 _pyio.py. Bug was in getting order of metaclass=abc.ABCMeta right
|
||||||
|
import abc
|
||||||
|
class IOBase(metaclass=abc.ABCMeta):
|
||||||
|
pass
|
||||||
|
@@ -515,7 +515,7 @@ def make_function3(self, node, is_lambda, nested=1, codeNode=None):
|
|||||||
expr_node = node[0]
|
expr_node = node[0]
|
||||||
if (expr_node[0] == 'LOAD_CONST' and
|
if (expr_node[0] == 'LOAD_CONST' and
|
||||||
isinstance(expr_node[0].attr, tuple)):
|
isinstance(expr_node[0].attr, tuple)):
|
||||||
defparams = list(expr_node[0].attr)
|
defparams = [repr(a) for a in expr_node[0].attr]
|
||||||
elif expr_node[0] in frozenset(('list', 'tuple', 'dict', 'set')):
|
elif expr_node[0] in frozenset(('list', 'tuple', 'dict', 'set')):
|
||||||
defparams = [self.traverse(n, indent='') for n in expr_node[0][:-1]]
|
defparams = [self.traverse(n, indent='') for n in expr_node[0][:-1]]
|
||||||
else:
|
else:
|
||||||
|
@@ -1954,13 +1954,13 @@ class SourceWalker(GenericASTTraversal, object):
|
|||||||
else:
|
else:
|
||||||
l = n
|
l = n
|
||||||
while i < l:
|
while i < l:
|
||||||
|
# 3.6+ may have this
|
||||||
|
if kwargs:
|
||||||
|
self.write("%s=" % kwargs[j])
|
||||||
|
j += 1
|
||||||
value = self.traverse(node[i])
|
value = self.traverse(node[i])
|
||||||
i += 1
|
i += 1
|
||||||
self.write(sep, value)
|
self.write(sep, value)
|
||||||
# 3.6+ may have this
|
|
||||||
if kwargs:
|
|
||||||
self.write("=%s" % kwargs[j])
|
|
||||||
j += 1
|
|
||||||
sep = line_separator
|
sep = line_separator
|
||||||
pass
|
pass
|
||||||
pass
|
pass
|
||||||
|
Reference in New Issue
Block a user