mirror of https://github.com/zulip/zulip.git
python: Clean up various if False blocks.
Most of these are now-unnecessary typing imports; some are just improved comments for those with other mypy motivations.
This commit is contained in:
parent
2558f101af
commit
a0da4f6d30
|
@ -1,8 +1,5 @@
|
|||
from django.conf import settings
|
||||
|
||||
if False:
|
||||
from zerver.models import UserProfile
|
||||
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from zerver.lib.avatar_hash import gravatar_hash, user_avatar_path_from_ids
|
||||
|
|
|
@ -17,8 +17,7 @@ from zerver.lib.topic import get_topic_from_message_info
|
|||
|
||||
import configparser
|
||||
|
||||
if False:
|
||||
from mypy_extensions import NoReturn
|
||||
from mypy_extensions import NoReturn
|
||||
from typing import Any, Optional, List, Dict
|
||||
from types import ModuleType
|
||||
|
||||
|
|
|
@ -19,9 +19,9 @@ import os
|
|||
import hashlib
|
||||
|
||||
if False:
|
||||
from zerver.models import UserProfile, Realm, Message
|
||||
# These modules have to be imported for type annotations but
|
||||
# they cannot be imported at runtime due to cyclic dependency.
|
||||
from zerver.models import UserProfile, Realm, Message
|
||||
|
||||
ReturnT = TypeVar('ReturnT') # Useful for matching return types via Callable[..., ReturnT]
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@ from zerver.models import (
|
|||
from zerver.lib.request import JsonableError
|
||||
|
||||
if False:
|
||||
# Avoid an import cycle; we only need these for type annotations.
|
||||
from zerver.lib.test_classes import ZulipTestCase, MigrationsTestCase
|
||||
|
||||
import collections
|
||||
|
|
Loading…
Reference in New Issue