Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
No untyped defs in synctl
Browse files Browse the repository at this point in the history
  • Loading branch information
David Robertson committed Apr 8, 2022
1 parent 871809a commit 8fb1187
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions synapse/_scripts/synctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import subprocess
import sys
import time
from typing import Iterable, Optional
from typing import Iterable, NoReturn, Optional, TextIO

import yaml

Expand All @@ -45,7 +45,7 @@
--------------------------------------------------------------------------------"""


def pid_running(pid):
def pid_running(pid: int) -> bool:
try:
os.kill(pid, 0)
except OSError as err:
Expand All @@ -68,7 +68,7 @@ def pid_running(pid):
return True


def write(message, colour=NORMAL, stream=sys.stdout):
def write(message: str, colour: str = NORMAL, stream: TextIO = sys.stdout) -> None:
# Lets check if we're writing to a TTY before colouring
should_colour = False
try:
Expand All @@ -84,7 +84,7 @@ def write(message, colour=NORMAL, stream=sys.stdout):
stream.write(colour + message + NORMAL + "\n")


def abort(message, colour=RED, stream=sys.stderr):
def abort(message: str, colour: str = RED, stream: TextIO = sys.stderr) -> NoReturn:
write(message, colour, stream)
sys.exit(1)

Expand Down Expand Up @@ -166,7 +166,7 @@ def stop(pidfile: str, app: str) -> Optional[int]:
)


def main():
def main() -> None:

parser = argparse.ArgumentParser()

Expand Down

0 comments on commit 8fb1187

Please sign in to comment.