zerver/lib: Use python 3 syntax for typing.

Extracted from a larger commit by tabbott because these changes will
not create significant merge conflicts.
This commit is contained in:
rht
2017-11-05 11:15:10 +01:00
committed by Tim Abbott
parent 561ba33f69
commit 3f4bf2d22f
35 changed files with 388 additions and 573 deletions

View File

@@ -12,8 +12,7 @@ from typing import Optional
# (that link also points to code for an interactive remote debugger
# setup, which we might want if we move Tornado to run in a daemon
# rather than via screen).
def interactive_debug(sig, frame):
# type: (int, FrameType) -> None
def interactive_debug(sig: int, frame: FrameType) -> None:
"""Interrupt running process, and provide a python prompt for
interactive debugging."""
d = {'_frame': frame} # Allow access to frame object.
@@ -27,7 +26,6 @@ def interactive_debug(sig, frame):
# SIGUSR1 => Just print the stack
# SIGUSR2 => Print stack + open interactive debugging shell
def interactive_debug_listen():
# type: () -> None
def interactive_debug_listen() -> None:
signal.signal(signal.SIGUSR1, lambda sig, stack: traceback.print_stack(stack))
signal.signal(signal.SIGUSR2, interactive_debug)