Replace 'type' with 'Type[BaseException]'.

This strengthens type checking and helps switch over to mypy 0.4.7.
This commit is contained in:
Eklavya Sharma 2017-01-31 15:15:32 +05:30 committed by Tim Abbott
parent 0badbbf0e2
commit b7635db1e4
1 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
from __future__ import absolute_import
from types import TracebackType
from typing import Any, Callable, Optional, Tuple, TypeVar
from typing import Any, Callable, Optional, Tuple, Type, TypeVar
import sys
import time
@ -42,7 +42,7 @@ def timeout(timeout, func, *args, **kwargs):
# type: () -> None
threading.Thread.__init__(self)
self.result = None # type: Optional[ResultT]
self.exc_info = None # type: Optional[Tuple[type, BaseException, TracebackType]]
self.exc_info = None # type: Optional[Tuple[Type[BaseException], BaseException, TracebackType]]
# Don't block the whole program from exiting
# if this is the only thread left.