content.py 文件源码

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

项目:kacpaw 作者: benburrill 项目源码 文件源码
def _comment_exists(self):
        """
        This is yet another horrible workaround to keep this from falling apart.

        Because of the other workarounds to get around the fact that you
        cannot get metadata from a comment, we've run into problems where it
        is not always obvious if a comment even exists.  For this reason, we
        need to have a method to test it for us.
        """
        try:
            # Getting the reply data from a comment should raise an error if
            # it doesn't exist.  We use Comment's get_reply_data because
            # ProgramCommentReply's get_reply_data is another one of those
            # horrible workarounds
            list(Comment(self.id, self.get_program()).get_reply_data())
        except requests.HTTPError:
            return False
        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号