Use TYPE_CHECKING instead of magic MYPY variable. (#8770)

This commit is contained in:
Patrick Cloke 2020-11-17 09:09:40 -05:00 committed by GitHub
parent f737368a26
commit 473dfec1e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 9 deletions

View file

@ -25,7 +25,7 @@ The methods that define policy are:
import abc
import logging
from contextlib import contextmanager
from typing import Dict, Iterable, List, Set, Tuple
from typing import TYPE_CHECKING, Dict, Iterable, List, Set, Tuple
from prometheus_client import Counter
from typing_extensions import ContextManager
@ -46,8 +46,7 @@ from synapse.util.caches.descriptors import cached
from synapse.util.metrics import Measure
from synapse.util.wheel_timer import WheelTimer
MYPY = False
if MYPY:
if TYPE_CHECKING:
from synapse.server import HomeServer
logger = logging.getLogger(__name__)