Skip to content

Commit f5b4385

Browse files
[3.14] Use a more clear example for the PEP 758 what's new section (GH-135118) (#135119)
Use a more clear example for the PEP 758 what's new section (GH-135118) (cherry picked from commit 1f51510) Co-authored-by: Pablo Galindo Salgado <[email protected]>
1 parent 5b3983b commit f5b4385

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)