Skip to content

Commit 1f51510

Browse files
authored
Use a more clear example for the PEP 758 what's new section (#135118)
1 parent cc581f3 commit 1f51510

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Doc/whatsnew/3.14.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -342,15 +342,16 @@ For example the following expressions are now valid:
342342
.. code-block:: python
343343
344344
try:
345-
release_new_sleep_token_album()
346-
except AlbumNotFound, SongsTooGoodToBeReleased:
347-
print("Sorry, no new album this year.")
345+
connect_to_server()
346+
except TimeoutError, ConnectionRefusedError:
347+
print("Network issue encountered.")
348348
349349
# The same applies to except* (for exception groups):
350+
350351
try:
351-
release_new_sleep_token_album()
352-
except* AlbumNotFound, SongsTooGoodToBeReleased:
353-
print("Sorry, no new album this year.")
352+
connect_to_server()
353+
except* TimeoutError, ConnectionRefusedError:
354+
print("Network issue encountered.")
354355
355356
Check :pep:`758` for more details.
356357

0 commit comments

Comments
 (0)