summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2022-10-15 23:13:33 +0100
committerGitHub <noreply@github.com>2022-10-15 23:13:33 +0100
commitbb56dead336357153a0c3b8cc9d9d6856d2c5a03 (patch)
treeb3e336da20cd08a82d86f19c054f8c780ee422da /Python/pythonrun.c
parent3a639bbeace73d54f7e5431d3224c8c8223d81ae (diff)
downloadcpython-git-bb56dead336357153a0c3b8cc9d9d6856d2c5a03.tar.gz
gh-98254: Include stdlib module names in error messages for NameErrors (#98255)
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index acb1330b85..a0005b32fc 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -1107,16 +1107,9 @@ print_exception_suggestions(struct exception_print_context *ctx,
PyObject *f = ctx->file;
PyObject *suggestions = _Py_Offer_Suggestions(value);
if (suggestions) {
- // Add a trailer ". Did you mean: (...)?"
- if (PyFile_WriteString(". Did you mean: '", f) < 0) {
- goto error;
- }
if (PyFile_WriteObject(suggestions, f, Py_PRINT_RAW) < 0) {
goto error;
}
- if (PyFile_WriteString("'?", f) < 0) {
- goto error;
- }
Py_DECREF(suggestions);
}
else if (PyErr_Occurred()) {