mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +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 tools.setup import setup_venvs
|
||||
|
||||
if False:
|
||||
# `NoReturn` was introduced in python 3.5.4
|
||||
from typing import List, NoReturn
|
||||
from typing import List, TYPE_CHECKING
|
||||
if TYPE_CHECKING:
|
||||
# mypy_extensions might not be installed yet
|
||||
from mypy_extensions import NoReturn
|
||||
|
||||
SUPPORTED_PLATFORMS = {
|
||||
"Ubuntu": [
|
||||
|
||||
@@ -4,10 +4,7 @@ import argparse
|
||||
import os
|
||||
import json
|
||||
import subprocess
|
||||
|
||||
if False:
|
||||
# `NoReturn` wasn't introduced until python 3.5.4
|
||||
from typing import NoReturn
|
||||
from mypy_extensions import NoReturn
|
||||
|
||||
os.chdir(os.path.join(os.path.dirname(__file__), '..'))
|
||||
STATIC_PATH = 'static/'
|
||||
|
||||
Reference in New Issue
Block a user