flake8_rst_docstrings.py 文件源码

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

项目:flake8-rst-docstrings 作者: peterjc 项目源码 文件源码
def load_source(self):
        """Load the source for the specified file."""
        if self.filename in self.STDIN_NAMES:
            self.filename = 'stdin'
            if sys.version_info[0] < 3:
                self.source = sys.stdin.read()
            else:
                self.source = TextIOWrapper(sys.stdin.buffer,
                                            errors='ignore').read()
        else:
            # Could be a Python 2.7 StringIO with no context manager, sigh.
            # with tokenize_open(self.filename) as fd:
            #     self.source = fd.read()
            handle = tokenize_open(self.filename)
            self.source = handle.read()
            handle.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号