You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Improve 3.7+ dotted imports
This commit is contained in:
@@ -239,13 +239,11 @@ case $PYVERSION in
|
||||
[test_dbm_gnu.py]=1 # Takes too long
|
||||
[test_decimal.py]=1 # Parse error
|
||||
[test_descr.py]=1 # Parse error
|
||||
[test_descrtut.py]=1 # Works in decompyle3 - dotted import errors - Investigate
|
||||
[test_dictcomps.py]=1 # Bad semantics - Investigate
|
||||
[test_dis.py]=1 # We change line numbers - duh!
|
||||
[test_eintr.py]=1 # Works in decompyle3 - dotted import errors - Investigate
|
||||
[test_enumerate.py]=1 #
|
||||
[test_enum.py]=1 #
|
||||
[test_exceptions.py]=1 # workss in decompile3; dotted import errors - Investigate
|
||||
[test_exceptions.py]=1 # works in decompile3; dotted import errors - Investigate
|
||||
[test_faulthandler.py]=1 # takes too long
|
||||
# ...
|
||||
)
|
||||
|
@@ -146,21 +146,3 @@ def customize_for_version37(self, version):
|
||||
"yield_from": ("yield from %c", (0, "expr")),
|
||||
}
|
||||
)
|
||||
|
||||
# Don't think we need this as long as we disambiguate
|
||||
# in parse37base.py "from ... import" vs. "import .. as"
|
||||
# def n_alias37(node):
|
||||
# assert len(node) == 2
|
||||
# import_from = node[0]
|
||||
# store = node[1]
|
||||
# assert store == "store"
|
||||
# if import_from == "IMPORT_FROM" and import_from.attr != store[0].attr:
|
||||
# template = ("%c as %c ", 0, 1)
|
||||
# else:
|
||||
# template = ("%c ", 1)
|
||||
# pass
|
||||
# self.template_engine(template, node)
|
||||
# self.prune()
|
||||
# return
|
||||
|
||||
# self.n_alias37 = n_alias37
|
||||
|
@@ -823,6 +823,7 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
else:
|
||||
self.write(iname, " as ", sname)
|
||||
self.prune() # stop recursing
|
||||
n_alias37 = n_alias
|
||||
|
||||
def n_import_from(self, node):
|
||||
relative_path_index = 0
|
||||
|
Reference in New Issue
Block a user