mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
tools: Use mypy_extensions for NoReturn.
This is the right way to access it with support for older Python versions where it might not be in typing yet.
This commit is contained in:
@@ -24,9 +24,10 @@ from scripts.lib.setup_venv import (
|
|||||||
from scripts.lib.node_cache import setup_node_modules, NODE_MODULES_CACHE_PATH
|
from scripts.lib.node_cache import setup_node_modules, NODE_MODULES_CACHE_PATH
|
||||||
from tools.setup import setup_venvs
|
from tools.setup import setup_venvs
|
||||||
|
|
||||||
if False:
|
from typing import List, TYPE_CHECKING
|
||||||
# `NoReturn` was introduced in python 3.5.4
|
if TYPE_CHECKING:
|
||||||
from typing import List, NoReturn
|
# mypy_extensions might not be installed yet
|
||||||
|
from mypy_extensions import NoReturn
|
||||||
|
|
||||||
SUPPORTED_PLATFORMS = {
|
SUPPORTED_PLATFORMS = {
|
||||||
"Ubuntu": [
|
"Ubuntu": [
|
||||||
|
|||||||
@@ -4,10 +4,7 @@ import argparse
|
|||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from mypy_extensions import NoReturn
|
||||||
if False:
|
|
||||||
# `NoReturn` wasn't introduced until python 3.5.4
|
|
||||||
from typing import NoReturn
|
|
||||||
|
|
||||||
os.chdir(os.path.join(os.path.dirname(__file__), '..'))
|
os.chdir(os.path.join(os.path.dirname(__file__), '..'))
|
||||||
STATIC_PATH = 'static/'
|
STATIC_PATH = 'static/'
|
||||||
|
|||||||
Reference in New Issue
Block a user