]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] Use a more clear example for the PEP 758 what's new section (GH-135118) (...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 4 Jun 2025 09:28:59 +0000 (11:28 +0200)
committerGitHub <noreply@github.com>
Wed, 4 Jun 2025 09:28:59 +0000 (09:28 +0000)
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 <Pablogsal@gmail.com>
Doc/whatsnew/3.14.rst

index 1e6a3615963ff451fc591fb20fcd5acf9573a043..1896410919d6b093837be7dfa6ad1a6d94635543 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.