summaryrefslogtreecommitdiffstats
path: root/Python/errors.c
diff options
context:
space:
mode:
authorTomas R. <tomas.roun8@gmail.com>2025-04-12 10:34:36 (GMT)
committerGitHub <noreply@github.com>2025-04-12 10:34:36 (GMT)
commit3d08c8ad20dfabd4864be139cd9c2eb5602ccdfe (patch)
treee1a0eb511b507db7c1d21be8f730504e55024e76 /Python/errors.c
parentd4e2cdc15bdfe84486b885eca885c44bc378fc41 (diff)
downloadcpython-3d08c8ad20dfabd4864be139cd9c2eb5602ccdfe.zip
cpython-3d08c8ad20dfabd4864be139cd9c2eb5602ccdfe.tar.gz
cpython-3d08c8ad20dfabd4864be139cd9c2eb5602ccdfe.tar.bz2
gh-131927: Prevent emitting optimizer warnings twice in the REPL (#131993)
Diffstat (limited to 'Python/errors.c')
-rw-r--r--Python/errors.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/errors.c b/Python/errors.c
index 14999d6..2b088e2 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -1906,8 +1906,8 @@ int
_PyErr_EmitSyntaxWarning(PyObject *msg, PyObject *filename, int lineno, int col_offset,
int end_lineno, int end_col_offset)
{
- if (PyErr_WarnExplicitObject(PyExc_SyntaxWarning, msg, filename,
- lineno, NULL, NULL) < 0)
+ if (_PyErr_WarnExplicitObjectWithContext(PyExc_SyntaxWarning, msg,
+ filename, lineno) < 0)
{
if (PyErr_ExceptionMatches(PyExc_SyntaxWarning)) {
/* Replace the SyntaxWarning exception with a SyntaxError