From d313e170b74639859c87c164f11e2979496c103d Mon Sep 17 00:00:00 2001 From: Shantanu Date: Tue, 26 May 2020 17:37:07 -0700 Subject: [PATCH] threading: update for py39 (#4087) --- stdlib/2and3/_dummy_threading.pyi | 8 ++++++-- stdlib/2and3/threading.pyi | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/stdlib/2and3/_dummy_threading.pyi b/stdlib/2and3/_dummy_threading.pyi index 5d716f00f..47731cb94 100644 --- a/stdlib/2and3/_dummy_threading.pyi +++ b/stdlib/2and3/_dummy_threading.pyi @@ -75,7 +75,8 @@ class Thread: @property def native_id(self) -> Optional[int]: ... # only available on some platforms def is_alive(self) -> bool: ... - def isAlive(self) -> bool: ... + if sys.version_info < (3, 9): + def isAlive(self) -> bool: ... def isDaemon(self) -> bool: ... def setDaemon(self, daemonic: bool) -> None: ... @@ -143,7 +144,10 @@ class Semaphore: def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... else: def acquire(self, blocking: bool = ...) -> bool: ... - def release(self) -> None: ... + if sys.version_info >= (3, 9): + def release(self, n: int = ...) -> None: ... + else: + def release(self) -> None: ... class BoundedSemaphore(Semaphore): ... diff --git a/stdlib/2and3/threading.pyi b/stdlib/2and3/threading.pyi index 5d716f00f..47731cb94 100644 --- a/stdlib/2and3/threading.pyi +++ b/stdlib/2and3/threading.pyi @@ -75,7 +75,8 @@ class Thread: @property def native_id(self) -> Optional[int]: ... # only available on some platforms def is_alive(self) -> bool: ... - def isAlive(self) -> bool: ... + if sys.version_info < (3, 9): + def isAlive(self) -> bool: ... def isDaemon(self) -> bool: ... def setDaemon(self, daemonic: bool) -> None: ... @@ -143,7 +144,10 @@ class Semaphore: def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... else: def acquire(self, blocking: bool = ...) -> bool: ... - def release(self) -> None: ... + if sys.version_info >= (3, 9): + def release(self, n: int = ...) -> None: ... + else: + def release(self) -> None: ... class BoundedSemaphore(Semaphore): ...