transport.py 文件源码

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

项目:python-zeep 作者: mvantellingen 项目源码 文件源码
def _load_remote_data(self, url):
        result = None

        async def _load_remote_data_async():
            nonlocal result
            with aiohttp.Timeout(self.load_timeout):
                response = await self.session.get(url)
                result = await response.read()
                try:
                    response.raise_for_status()
                except aiohttp.ClientError as exc:
                    raise TransportError(
                        message=str(exc),
                        status_code=response.status,
                        content=result
                    ).with_traceback(exc.__traceback__) from exc

        # Block until we have the data
        self.loop.run_until_complete(_load_remote_data_async())
        return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号