typing: Convert function type annotations to Python 3 style.
Generated by com2ann (slightly patched to avoid also converting assignment type annotations, which require Python 3.6), followed by some manual whitespace adjustment, and two fixes for use-before-define issues: - def set_zulip_client(self, zulipToJabberClient: ZulipToJabberBot) -> None: + def set_zulip_client(self, zulipToJabberClient: 'ZulipToJabberBot') -> None: -def init_from_options(options: Any, client: Optional[str] = None) -> Client: +def init_from_options(options: Any, client: Optional[str] = None) -> 'Client': Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
parent
7c5f73dce9
commit
5428c5f296
42 changed files with 311 additions and 577 deletions
|
@ -14,8 +14,7 @@ from zephyr_mirror_backend import parse_args
|
|||
from types import FrameType
|
||||
from typing import Any
|
||||
|
||||
def die(signal, frame):
|
||||
# type: (int, FrameType) -> None
|
||||
def die(signal: int, frame: FrameType) -> None:
|
||||
|
||||
# We actually want to exit, so run os._exit (so as not to be caught and restarted)
|
||||
os._exit(1)
|
||||
|
@ -40,8 +39,7 @@ if options.forward_class_messages and not options.noshard:
|
|||
print("Starting parallel zephyr class mirroring bot")
|
||||
jobs = list("0123456789abcdef")
|
||||
|
||||
def run_job(shard):
|
||||
# type: (str) -> int
|
||||
def run_job(shard: str) -> int:
|
||||
subprocess.call(args + ["--shard=%s" % (shard,)])
|
||||
return 0
|
||||
for (status, job) in run_parallel(run_job, jobs, threads=16):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue