Skip to content

Commit cd528b6

Browse files
committed
Update with latest code
1 parent 77f9de1 commit cd528b6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎Python/suggestions.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,12 @@ offer_suggestions_for_import_error(PyImportErrorObject *exc)
333333
return NULL;
334334
}
335335

336-
PyObject *suggestions = calculate_suggestions(dir, name);
336+
PyObject *suggestion = calculate_suggestions(dir, name);
337337
Py_DECREF(dir);
338-
return suggestions;
338+
339+
PyObject* result = PyUnicode_FromFormat(". Did you mean: %R?", suggestion);
340+
Py_DECREF(suggestion);
341+
return result;
339342
}
340343

341344
// Offer suggestions for a given exception. Returns a python string object containing the

0 commit comments

Comments
 (0)