diff options
-rw-r--r-- | src/buildstream/_signals.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/buildstream/_signals.py b/src/buildstream/_signals.py index 969789e92..03b55b052 100644 --- a/src/buildstream/_signals.py +++ b/src/buildstream/_signals.py @@ -23,22 +23,15 @@ import threading import traceback from contextlib import contextmanager, ExitStack from collections import deque -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from typing import Callable, MutableSequence +from typing import Callable, Deque # Global per process state for handling of sigterm/sigtstp/sigcont, # note that it is expected that this only ever be used by new processes # the scheduler starts, not the main process. # -# FIXME: We should ideally be using typing.Deque as type hints below, not -# typing.MutableSequence. However, that is only available in Python versions -# 3.5.4 onward and 3.6.1 onward. -# Debian 9 ships with 3.5.3. -terminator_stack = deque() # type: MutableSequence[Callable] -suspendable_stack = deque() # type: MutableSequence[Callable] +terminator_stack: Deque[Callable] = deque() +suspendable_stack: Deque[Callable] = deque() # Per process SIGTERM handler |