def cache_py2_modules():
"""
Currently this function is unneeded, as we are not attempting to provide import hooks
for modules with ambiguous names: email, urllib, pickle.
"""
if len(sys.py2_modules) != 0:
return
assert not detect_hooks()
import urllib
sys.py2_modules['urllib'] = urllib
import email
sys.py2_modules['email'] = email
import pickle
sys.py2_modules['pickle'] = pickle
# Not all Python installations have test module. (Anaconda doesn't, for example.)
# try:
# import test
# except ImportError:
# sys.py2_modules['test'] = None
# sys.py2_modules['test'] = test
# import dbm
# sys.py2_modules['dbm'] = dbm
评论列表
文章目录