When this pattern is checked in py2 mode (or really any pre-3.5 version)
try:
from inspect import isawaitable # py35+
except ImportError:
from backports_abc import isawaitable
it raises an error tornado/gen.py:118: error: Module has no attribute 'isawaitable'. Instead, mypy should recognize that this is within a try/except block that catches the ImportError and choose the alternate path instead.
This falls under the umbrella of #1297 but I couldn't find an exact match for this issue.
When this pattern is checked in py2 mode (or really any pre-3.5 version)
it raises an error
tornado/gen.py:118: error: Module has no attribute 'isawaitable'. Instead, mypy should recognize that this is within a try/except block that catches theImportErrorand choose the alternate path instead.This falls under the umbrella of #1297 but I couldn't find an exact match for this issue.