Skip to content

Commit f93965c

Browse files
authored
Drop some of the sys.version_info conditionals. (oppia#21267)
1 parent 9ccf412 commit f93965c

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

stubs/threading/__init__.pyi

+6-11
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ if sys.version_info >= (3, 10):
3434
def getprofile() -> Optional[ProfileFunction]: ...
3535
__all__ += ["getprofile", "gettrace"]
3636

37-
if sys.version_info >= (3, 8):
38-
from _thread import get_native_id as get_native_id
39-
__all__ += ["ExceptHookArgs", "excepthook", "get_native_id"]
37+
from _thread import get_native_id as get_native_id
38+
__all__ += ["ExceptHookArgs", "excepthook", "get_native_id"]
4039

4140
ProfileFunction = Callable[..., Any]
4241
TraceFunction = Callable[..., Any]
@@ -149,10 +148,7 @@ class Semaphore:
149148
def __enter__(
150149
self, blocking: bool = ..., timeout: Optional[float] = ...
151150
) -> bool: ...
152-
if sys.version_info >= (3, 9):
153-
def release(self, n: int = ...) -> None: ...
154-
else:
155-
def release(self) -> None: ...
151+
def release(self, n: int = ...) -> None: ...
156152

157153
class BoundedSemaphore(Semaphore): ...
158154

@@ -163,11 +159,10 @@ class Event:
163159
def clear(self) -> None: ...
164160
def wait(self, timeout: Optional[float] = ...) -> bool: ...
165161

166-
if sys.version_info >= (3, 8):
167-
from _thread import _excepthook, _ExceptHookArgs
162+
from _thread import _excepthook, _ExceptHookArgs
168163

169-
excepthook = _excepthook
170-
ExceptHookArgs = _ExceptHookArgs
164+
excepthook = _excepthook
165+
ExceptHookArgs = _ExceptHookArgs
171166

172167
class Timer(Thread):
173168
args: Iterable[Any]

0 commit comments

Comments
 (0)