diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2022-10-15 23:13:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-15 23:13:33 +0100 |
commit | bb56dead336357153a0c3b8cc9d9d6856d2c5a03 (patch) | |
tree | b3e336da20cd08a82d86f19c054f8c780ee422da /Python/pythonrun.c | |
parent | 3a639bbeace73d54f7e5431d3224c8c8223d81ae (diff) | |
download | cpython-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.c | 7 |
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()) { |