bpo-25460: Surround suggestions by quotes (GH-25473)

This commit is contained in:
Pablo Galindo 2021-04-19 23:35:53 +01:00 committed by GitHub
parent 4f9ffa8f9c
commit 7a04116246
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 16 deletions

View file

@ -956,10 +956,10 @@ print_exception(PyObject *f, PyObject *value)
PyObject* suggestions = _Py_Offer_Suggestions(value);
if (suggestions) {
// Add a trailer ". Did you mean: (...)?"
err = PyFile_WriteString(". Did you mean: ", f);
err = PyFile_WriteString(". Did you mean: '", f);
if (err == 0) {
err = PyFile_WriteObject(suggestions, f, Py_PRINT_RAW);
err += PyFile_WriteString("?", f);
err += PyFile_WriteString("'?", f);
}
Py_DECREF(suggestions);
} else if (PyErr_Occurred()) {