You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
Imports yet again
This commit is contained in:
@@ -1295,9 +1295,15 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
relative_path_index = 0
|
||||
if self.version >= 2.5:
|
||||
if node[relative_path_index].attr > 0:
|
||||
node[2].pattr = '.' * (node[relative_path_index].pattr + node[2].attr)
|
||||
if isinstance(node[1].pattr, tuple):
|
||||
node[1].pattr = '.'.join(node[1].pattr)
|
||||
node[2].pattr = ('.' * node[relative_path_index].pattr) + node[2].pattr
|
||||
if self.version > 2.7:
|
||||
if isinstance(node[1].pattr, tuple):
|
||||
imports = node[1].pattr
|
||||
for pattr in imports:
|
||||
node[1].pattr = pattr
|
||||
self.default(node)
|
||||
return
|
||||
pass
|
||||
self.default(node)
|
||||
|
||||
n_import_from_star = n_import_from
|
||||
|
Reference in New Issue
Block a user