Fix Python 3.7+ "import as" but keep "import from" working

This commit is contained in:
rocky
2019-12-28 11:09:31 -05:00
parent 62c249d6b2
commit b2e1edb434
12 changed files with 36 additions and 9 deletions

View File

@@ -1,7 +1,14 @@
# From 3.7 test_cmath.py
# Had bug in 3.x in not having semantic importlist rule
def main(osp, Mfile, mainpyfile, dbg=None):
try:
from xdis import load_module, PYTHON_VERSION, IS_PYPY
return PYTHON_VERSION, IS_PYPY, load_module
except:
pass
# bug is treating "import as" as "from xx import" while
# still being able to hand "from xx import" properly
# RUNNABLE!
import os.path as osp
from sys import path
from os import sep, name
assert osp.basename("a")
assert path
assert sep
assert name