Python 等待响应准备(请求)属性错误:';非类型';对象没有属性';准备';

Python 等待响应准备(请求)属性错误:';非类型';对象没有属性';准备';,python,attributeerror,aiohttp,pytest-aiohttp,Python,Attributeerror,Aiohttp,Pytest Aiohttp,但是每当我尝试访问url时,我都会遇到这个错误 async def index(request): async with aiohttp.ClientSession() as client: data=await(email_verification(client)) await client.post('http://127.0.0.1:8000/acc/signup',data=data) async def email_verificati

但是每当我尝试访问url时,我都会遇到这个错误

async def index(request):
    async with aiohttp.ClientSession() as client:
        data=await(email_verification(client))


        await client.post('http://127.0.0.1:8000/acc/signup',data=data)



async def email_verification(client):
    async with client.get('http://www.mocky.io/v2/5c18dfb62f00005b00af1241') as resp:

        return await(resp.json())

我甚至无法理解问题是什么,以及此resp.prepare来自何处。请Web处理程序应返回响应对象,而不是无响应对象

固定代码为:

   await resp.prepare(request)
AttributeError: 'NoneType' object has no attribute 'prepare'

Web处理程序应返回响应对象,而不是无响应对象

固定代码为:

   await resp.prepare(request)
AttributeError: 'NoneType' object has no attribute 'prepare'