You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Fix Python 3.7+ "import as" but keep "import from" working
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user