Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix test
  • Loading branch information
pablogsal committed Oct 13, 2022
commit 5103f8cfeeed17bc3a2ea2ff1b9699a63a51e668
4 changes: 2 additions & 2 deletions Python/suggestions.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,11 @@ offer_suggestions_for_name_error(PyNameErrorObject *exc)
// Add a trailer ". Did you mean: (...)?"
PyObject* result = NULL;
if (!is_stdlib_module) {
result = PyUnicode_FromFormat(". Did you mean %R?", suggestion);
result = PyUnicode_FromFormat(". Did you mean: %R?", suggestion);
} else if (suggestion == NULL) {
result = PyUnicode_FromFormat(". Did you forget to import %R?", name);
} else {
result = PyUnicode_FromFormat(". Did you mean %R? Or did you forget to import %R?", suggestion, name);
result = PyUnicode_FromFormat(". Did you mean: %R? Or did you forget to import %R?", suggestion, name);
}
Py_XDECREF(suggestion);
return result;
Expand Down