python: Use standard NoReturn (Python ≥ 3.6).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-06-11 12:18:16 -07:00
committed by Tim Abbott
parent fbc96d56d5
commit ca4357fd64
7 changed files with 8 additions and 15 deletions

View File

@@ -8,11 +8,7 @@ secondary Postgres servers' xlog location.
import configparser
import subprocess
import re
from typing import TYPE_CHECKING
if TYPE_CHECKING:
# typing_extensions might not be installed
from typing_extensions import NoReturn
from typing import NoReturn
states = {
"OK": 0,

View File

@@ -5,7 +5,7 @@
# Django itself
Django==2.2.*
# needed for Deque (in Python < 3.5.4) and TypedDict
# needed for Literal, TypedDict
typing-extensions
# Needed for rendering backend templates

View File

@@ -24,8 +24,7 @@ from tools.setup import setup_venvs
from typing import List, TYPE_CHECKING
if TYPE_CHECKING:
# typing_extensions might not be installed yet
from typing_extensions import NoReturn
from typing import NoReturn
VAR_DIR_PATH = os.path.join(ZULIP_PATH, 'var')

View File

@@ -4,7 +4,7 @@ import argparse
import os
import json
import subprocess
from typing_extensions import NoReturn
from typing import NoReturn
os.chdir(os.path.join(os.path.dirname(__file__), '..'))
STATIC_PATH = 'static/'

View File

@@ -1,6 +1,5 @@
from enum import Enum
from typing import Any, Dict, List, Type, TypeVar, Optional
from typing_extensions import NoReturn
from typing import Any, Dict, List, NoReturn, Type, TypeVar, Optional
from django.utils.translation import ugettext as _

View File

@@ -9,8 +9,7 @@ from django.utils.log import AdminEmailHandler
from functools import wraps
from unittest.mock import MagicMock, patch
from types import TracebackType
from typing import Any, Callable, Dict, Iterator, Optional, Tuple, Type
from typing_extensions import NoReturn
from typing import Any, Callable, Dict, Iterator, NoReturn, Optional, Tuple, Type
from zerver.lib.types import ViewFuncT
from zerver.lib.test_classes import ZulipTestCase

View File

@@ -1,8 +1,8 @@
# See https://zulip.readthedocs.io/en/latest/subsystems/events-system.html for
# high-level documentation on how this system works.
from typing import cast, AbstractSet, Any, Callable, Dict, List, \
from typing import cast, AbstractSet, Any, Callable, Deque, Dict, List, \
Mapping, MutableMapping, Optional, Iterable, Sequence, Set, Union
from typing_extensions import Deque, TypedDict
from typing_extensions import TypedDict
from django.utils.translation import ugettext as _
from django.conf import settings