-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Closed
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
This code produces two SyntaxWarnings in the new REPL:
>>> def some():
... try:
... return 1
... finally:
... return 2
...
<python-input-14>:5: SyntaxWarning: 'return' in a 'finally' block
<python-input-14>:5: SyntaxWarning: 'return' in a 'finally' block
But, in our old REPL it produces just one:
Other SyntaxWarnings also do not show the same behavior in the new REPL. Example:
So, looks like only PEP-765 is affected, only in the new REPL.
Linked PRs
- gh-131927: Prevent emitting optimizer warnings twice in the REPL #131993
- [3.13] gh-131927: Prevent emitting optimizer warnings twice in the REPL (GH-131993) #132463
- gh-131927: Do not emit PEP 765 warnings in ast.parse() #139642
- gh-131927: Silence PEP 765 warnings in PyREPL #139719
- [3.14] gh-131927: Do not emit PEP 765 warnings in ast.parse() (GH-139642) #140786
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error