You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Lib/tabnanny.py module, the exception handling for IndentationError might not be reachable after SyntaxError is caught and a return statement is executed.
Why This Happens:
According to https://docs.python.org/3/library/exceptions.html#exception-hierarchy , we can learn that SyntaxError detection range than IndentationError bigger, Is the inclusion relationship. IndentationError is written after SyntaxError, which causes the program to never execute IndentationError
How to Fix:
We need to put the more specific IndentationError before SyntaxError
Activity
[-]Incorrect Exception Handling in `tabnanny.py`[/-][+]Incorrect exception handling in Tab Nanny[/+]gh-120495: Fix incorrect exception handling in Tab Nanny (#120498)
pythongh-120495: Fix incorrect exception handling in Tab Nanny (pytho…
pythongh-120495: Fix incorrect exception handling in Tab Nanny (pytho…
[3.12] gh-120495: Fix incorrect exception handling in Tab Nanny (GH-1…
[3.13] gh-120495: Fix incorrect exception handling in Tab Nanny (GH-1…
pythongh-120495: Fix incorrect exception handling in Tab Nanny (pytho…
pythongh-120495: Fix incorrect exception handling in Tab Nanny (pytho…
pythongh-120495: Fix incorrect exception handling in Tab Nanny (pytho…