Skip to content

Commit 8c7256c

Browse files
guocipre-commit-ci[bot]AlexWaygood
authored
[stdlib] Add locked method to threading.Condition (#15075)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Alex Waygood <[email protected]>
1 parent cc79232 commit 8c7256c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

stdlib/@tests/stubtest_allowlists/py314.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ concurrent.interpreters._queues.UNBOUND_REMOVE
4040

4141
importlib.util.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility
4242

43+
# Condition functions are exported in __init__
44+
threading.Condition.locked
45+
multiprocessing.dummy.Condition.locked
4346

4447
# ====================================
4548
# Pre-existing errors from Python 3.13

stdlib/threading.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ class Condition:
144144
) -> None: ...
145145
def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ...
146146
def release(self) -> None: ...
147+
if sys.version_info >= (3, 14):
148+
def locked(self) -> bool: ...
149+
147150
def wait(self, timeout: float | None = None) -> bool: ...
148151
def wait_for(self, predicate: Callable[[], _T], timeout: float | None = None) -> _T: ...
149152
def notify(self, n: int = 1) -> None: ...

0 commit comments

Comments
 (0)