demjson.py 文件源码

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

项目:kodi-bandcamp 作者: wallon-ines 项目源码 文件源码
def _do_decode(self, state):
        """This is the internal function that does the JSON decoding.

        Called by the decode() method, after it has performed any Unicode decoding, etc.
        """
        buf = state.buf
        self.skipws(state)

        if buf.at_end:
            state.push_error('No value to decode')
        else:
            if state.options.decimal_context:
                dec_ctx = decimal.localcontext( state.options.decimal_context )
            else:
                dec_ctx = _dummy_context_manager

            with dec_ctx:
                state.obj = self.decodeobj(state, at_document_start=True )

            if not state.should_stop:
                # Make sure there's nothing at the end
                self.skipws(state)
                if not buf.at_end:
                    state.push_error('Unexpected text after end of JSON value')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号