vcs_repo.py 文件源码

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

项目:punch 作者: lgiordani 项目源码 文件源码
def _check_system(self):
        null_commands = self.commands + ["--help"]

        if six.PY2:
            not_found_exception = IOError
        else:
            not_found_exception = FileNotFoundError

        try:
            if six.PY2:
                subprocess.check_output(null_commands)
            else:
                subprocess.check_call(null_commands, stdout=subprocess.DEVNULL)

        except not_found_exception:
            raise RepositorySystemError("Cannot run {}".format(self.command))
        except subprocess.CalledProcessError:
            raise RepositorySystemError(
                "Error running {}".format(self.command))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号