You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
Fix up retreiving "async" property on 3.6
This commit is contained in:
@@ -363,9 +363,14 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
|
||||
|
||||
def n_funcdef(node):
|
||||
if self.version == 3.6:
|
||||
code_node = node[0][0]
|
||||
else:
|
||||
code_node = node[0][1]
|
||||
if (code_node == 'LOAD_CONST' and iscode(code_node.attr)
|
||||
and code_node.attr.co_flags & COMPILER_FLAG_BIT['COROUTINE']):
|
||||
|
||||
is_code = hasattr(code_node, 'attr') and iscode(code_node.attr)
|
||||
if (is_code and
|
||||
(code_node.attr.co_flags & COMPILER_FLAG_BIT['COROUTINE'])):
|
||||
self.engine(('\n\n%|async def %c\n', -2), node)
|
||||
else:
|
||||
self.engine(('\n\n%|def %c\n', -2), node)
|
||||
|
Reference in New Issue
Block a user