mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
gh-139640: Fix swallowing syntax warnings in different modules (GH-139755)
Revert GH-131993. Fix swallowing some syntax warnings in different modules if they accidentally have the same message and are emitted from the same line.
This commit is contained in:
parent
1ff6d69fbe
commit
279db6bede
7 changed files with 62 additions and 74 deletions
|
|
@ -1962,8 +1962,8 @@ int
|
|||
_PyErr_EmitSyntaxWarning(PyObject *msg, PyObject *filename, int lineno, int col_offset,
|
||||
int end_lineno, int end_col_offset)
|
||||
{
|
||||
if (_PyErr_WarnExplicitObjectWithContext(PyExc_SyntaxWarning, msg,
|
||||
filename, lineno) < 0)
|
||||
if (PyErr_WarnExplicitObject(PyExc_SyntaxWarning, msg,
|
||||
filename, lineno, NULL, NULL) < 0)
|
||||
{
|
||||
if (PyErr_ExceptionMatches(PyExc_SyntaxWarning)) {
|
||||
/* Replace the SyntaxWarning exception with a SyntaxError
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue