def setUpClass(cls):
# we compile the bytecode with the testing python interpreter
import py_compile
source_py = os.path.join(os.path.dirname(__file__), 'nspkg', 'subpkg', 'bytecode_source.py')
dest_pyc = os.path.join(os.path.dirname(__file__), 'nspkg', 'subpkg', 'bytecode.pyc') # CAREFUL where
py_compile.compile(source_py, dest_pyc, doraise=True)
source_py = os.path.join(os.path.dirname(__file__), 'pkg', 'bytecode_source.py')
dest_pyc = os.path.join(os.path.dirname(__file__), 'pkg', 'bytecode.pyc') # CAREFUL where
py_compile.compile(source_py, dest_pyc, doraise=True)
import filefinder2 as importlib
importlib.activate()
# Note : filefinder2 will also be used with python3, but it should internally use importlib.
test_filefinder2_importlib_loadmodule.py 文件源码
python
阅读 28
收藏 0
点赞 0
评论 0
评论列表
文章目录