]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Use a more clear example for the PEP 758 what's new section (#135118)
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Wed, 4 Jun 2025 09:23:08 +0000 (10:23 +0100)
committerGitHub <noreply@github.com>
Wed, 4 Jun 2025 09:23:08 +0000 (09:23 +0000)
Doc/whatsnew/3.14.rst

index 27dfc75c90fbe9292a1a72a9d7e293418eede1ce..45e68aea5fb9a2618af9d826d1dd349a2f15198a 100644 (file)
@@ -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.