Improve 3.7+ dotted imports

This commit is contained in:
rocky
2020-01-03 21:22:55 -05:00
parent 498df35a6c
commit 077f192711
3 changed files with 2 additions and 21 deletions

View File

@@ -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
# ...
)

View File

@@ -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

View File

@@ -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