mirror of
https://github.com/python/cpython.git
synced 2025-09-12 19:57:40 +00:00
[3.10] bpo-44305: Improve syntax error for try blocks without except or finally (GH-26523) (GH-26524)
(cherry picked from commit b250f89bb7
)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
This commit is contained in:
parent
3283bf4519
commit
e53f72a1b4
5 changed files with 554 additions and 440 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue