Starting with the following using `mypy` version `0.640`: ``` $ python3 -m venv .venv $ .venv/bin/pip install -U aiohttp mypy $ echo "import aiohttp" > test.py ``` Running `.venv/bin/mypy test.py` leads to an error: ``` mypy: can't read file '/Users/bryan/Projects/mypy-repro/.venv/lib/python3.7/site-packages/aiohttp/_websocket': No such file or directory ``` This module is a C module that is imported like this: ```python if NO_EXTENSIONS: _websocket_mask = _websocket_mask_python else: try: from ._websocket import _websocket_mask_cython # type: ignore _websocket_mask = _websocket_mask_cython except ImportError: # pragma: no cover _websocket_mask = _websocket_mask_python ```
Activity
gvanrossum commentedon Oct 12, 2018
Yeah, I can repro this too. And it's a regression from 0.630. :-(
add test to repro python#5784
add test to actually reproduce python#5784
Avoid "No such file or directory" if module ancestor doesn't exist (p…