mypy error - Module 'aiohttp' has no attribute 'ClientTimeout' #3468
Closed
Description
Long story short
I have the following example Python file:
example.py
from aiohttp import ClientSession
from aiohttp import ClientTimeout
timeout = ClientTimeout()
print(timeout)Expected behaviour
Mypy returns no errors.
Actual behaviour
Running mypy on the above example file returns the following error:
example.py:2: error: Module 'aiohttp' has no attribute 'ClientTimeout'
Steps to reproduce
$ docker run --rm -it -v `pwd`:`pwd` python:3.6.7-slim bash
root@8a1b86a205ee:/# pip install mypy aiohttp
...
Successfully installed aiohttp-3.5.1 async-timeout-3.0.1 attrs-18.2.0 chardet-3.0.4 idna-2.8 idna-ssl-1.1.0 multidict-4.5.2 mypy-0.650 mypy-extensions-0.4.1 typed-ast-1.1.1 typing-extensions-3.6.6 yarl-1.3.0
root@8a1b86a205ee:/# python /home/thanos/Dev/example/example.py
ClientTimeout(total=None, connect=None, sock_read=None, sock_connect=None)
root@8a1b86a205ee:/# mypy /home/thanos/Dev/example/example.py
home/thanos/Dev/example/example.py:2: error: Module 'aiohttp' has no attribute 'ClientTimeout'