glob.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:bigcode-tools 作者: tuvistavie 项目源码 文件源码
def _iterdir(dirname, dironly):
    if not dirname:
        if isinstance(dirname, bytes):
            dirname = bytes(os.curdir, 'ASCII')
        else:
            dirname = os.curdir
    try:
        it = scandir(dirname)
        for entry in it:
            try:
                if not dironly or entry.is_dir():
                    yield entry.name
            except OSError:
                pass
    except OSError:
        return

# Recursively yields relative pathnames inside a literal directory.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号