forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pythongh-96052: codeop: fix handling compiler warnings in incomplete …
…input (pythonGH-96132) Previously codeop.compile_command() emitted compiler warnings (SyntaxWarning or DeprecationWarning) and raised a SyntaxError for incomplete input containing a potentially incorrect code. Now it always returns None for incomplete input without emitting any warnings.
- Loading branch information
1 parent
e47b96c
commit 426d72e
Showing
3 changed files
with
37 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
Misc/NEWS.d/next/Library/2022-08-20-10-31-01.gh-issue-96052.a6FhaD.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Fix handling compiler warnings (SyntaxWarning and DeprecationWarning) in | ||
:func:`codeop.compile_command` when checking for incomplete input. | ||
Previously it emitted warnings and raised a SyntaxError. Now it always | ||
returns ``None`` for incomplete input without emitting any warnings. |