def _find_all_submodules(self, m):
if not m.packagepath:
return
# 'suffixes' used to be a list hardcoded to [".py", ".pyc", ".pyo"].
# But we must also collect Python extension modules - although
# we cannot separate normal dlls from Python extensions.
suffixes = [triple[0] for triple in imp.get_suffixes()]
for path in m.packagepath:
try:
names = zipio.listdir(path)
except (os.error, IOError):
self.msg(2, "can't list directory", path)
continue
for info in (moduleInfoForPath(p) for p in names):
if info is None: continue
if info[0] != '__init__':
yield info[0]
评论列表
文章目录