From 06e88ef3309e76552dfd20fc483c7b3a567f0d0a Mon Sep 17 00:00:00 2001 From: Pablo Galindo Salgado Date: Wed, 4 Jun 2025 10:23:08 +0100 Subject: [PATCH] Use a more clear example for the PEP 758 what's new section (GH-135118) (cherry picked from commit 1f515104441898111c20aca5a7bbda1d11b15d36) Co-authored-by: Pablo Galindo Salgado --- Doc/whatsnew/3.14.rst | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst index 1e6a3615963ff4..1896410919d6b0 100644 --- a/Doc/whatsnew/3.14.rst +++ b/Doc/whatsnew/3.14.rst @@ -342,15 +342,16 @@ For example the following expressions are now valid: .. code-block:: python try: - release_new_sleep_token_album() - except AlbumNotFound, SongsTooGoodToBeReleased: - print("Sorry, no new album this year.") + connect_to_server() + except TimeoutError, ConnectionRefusedError: + print("Network issue encountered.") # The same applies to except* (for exception groups): + try: - release_new_sleep_token_album() - except* AlbumNotFound, SongsTooGoodToBeReleased: - print("Sorry, no new album this year.") + connect_to_server() + except* TimeoutError, ConnectionRefusedError: + print("Network issue encountered.") Check :pep:`758` for more details.