Skip to content

Commit 657c68d

Browse files
committed
Add docs
1 parent b330172 commit 657c68d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Doc/library/exceptions.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,9 @@ The following exceptions are the exceptions that are usually raised.
429429

430430
* Creating a new Python thread.
431431
* :meth:`Joining <threading.Thread.join>` a running daemon thread.
432-
* :func:`os.fork`.
432+
* :func:`os.fork`,
433+
* acquiring a lock such as :cls:`threading.Lock`, when it is known that
434+
the operation would otherwise deadlock.
433435

434436
See also the :func:`sys.is_finalizing` function.
435437

@@ -440,6 +442,11 @@ The following exceptions are the exceptions that are usually raised.
440442

441443
:meth:`threading.Thread.join` can now raise this exception.
442444

445+
.. versionchanged:: next
446+
447+
This exception may be raised when acquiring :meth:`threading.Lock`
448+
or :meth:`threading.RLock`.
449+
443450
.. exception:: RecursionError
444451

445452
This exception is derived from :exc:`RuntimeError`. It is raised when the
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Acquiring a :cls:`threading.Lock` or :cls:`threading.RLock` at interpreter
2+
shutdown will raise :exc:`PythonFinalizationError` if Python can determine
3+
that it would otherwise deadlock.

0 commit comments

Comments
 (0)