diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2021-06-03 23:11:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-03 23:11:43 (GMT) |
commit | e53f72a1b42e17a331ed14bec674b1ee01d0720c (patch) | |
tree | fd4f350d1f95abc3f8107ebf9167a554d93ba23d /Doc/whatsnew | |
parent | 3283bf4519139cf62ba04a76930f84ca1e7da910 (diff) | |
download | cpython-e53f72a1b42e17a331ed14bec674b1ee01d0720c.zip cpython-e53f72a1b42e17a331ed14bec674b1ee01d0720c.tar.gz cpython-e53f72a1b42e17a331ed14bec674b1ee01d0720c.tar.bz2 |
[3.10] bpo-44305: Improve syntax error for try blocks without except or finally (GH-26523) (GH-26524)
(cherry picked from commit b250f89bb7e05e72a4641d44b988866b919575db)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.10.rst | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index beaa81a..af67582 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -274,6 +274,20 @@ have been incorporated. Some of the most notable ones: (Contributed by Pablo Galindo in :issue:`43823`) +* ``try`` blocks without ``except`` or ``finally`` blocks: + + .. code-block:: python + + >>> try + ... x = 2 + ... something = 3 + File "<stdin>", line 3 + something = 3 + ^^^^^^^^^ + SyntaxError: expected 'except' or 'finally' block + + (Contributed by Pablo Galindo in :issue:`44305`) + * Usage of ``=`` instead of ``==`` in comparisons: .. code-block:: python |