diff options
| author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2023-08-17 18:39:42 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-17 18:39:42 (GMT) |
| commit | 75b3db8445188c2ad38cabc0021af694df0829b8 (patch) | |
| tree | 0787c79b66363158b539a0de86a0b3ef6c37d0eb /Python/suggestions.c | |
| parent | 61c7249759ce88465ea655d5c19d17d03ff3f74b (diff) | |
| download | cpython-75b3db8445188c2ad38cabc0021af694df0829b8.zip cpython-75b3db8445188c2ad38cabc0021af694df0829b8.tar.gz cpython-75b3db8445188c2ad38cabc0021af694df0829b8.tar.bz2 | |
gh-107944: Improve error message for function calls with bad keyword arguments (#107969)
Diffstat (limited to 'Python/suggestions.c')
| -rw-r--r-- | Python/suggestions.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Python/suggestions.c b/Python/suggestions.c index 47aeb08..12097f7 100644 --- a/Python/suggestions.c +++ b/Python/suggestions.c @@ -126,8 +126,8 @@ levenshtein_distance(const char *a, size_t a_size, return result; } -static inline PyObject * -calculate_suggestions(PyObject *dir, +PyObject * +_Py_CalculateSuggestions(PyObject *dir, PyObject *name) { assert(!PyErr_Occurred()); @@ -195,7 +195,7 @@ get_suggestions_for_attribute_error(PyAttributeErrorObject *exc) return NULL; } - PyObject *suggestions = calculate_suggestions(dir, name); + PyObject *suggestions = _Py_CalculateSuggestions(dir, name); Py_DECREF(dir); return suggestions; } @@ -259,7 +259,7 @@ get_suggestions_for_name_error(PyObject* name, PyFrameObject* frame) } } - PyObject *suggestions = calculate_suggestions(dir, name); + PyObject *suggestions = _Py_CalculateSuggestions(dir, name); Py_DECREF(dir); if (suggestions != NULL || PyErr_Occurred()) { return suggestions; @@ -269,7 +269,7 @@ get_suggestions_for_name_error(PyObject* name, PyFrameObject* frame) if (dir == NULL) { return NULL; } - suggestions = calculate_suggestions(dir, name); + suggestions = _Py_CalculateSuggestions(dir, name); Py_DECREF(dir); if (suggestions != NULL || PyErr_Occurred()) { return suggestions; @@ -279,7 +279,7 @@ get_suggestions_for_name_error(PyObject* name, PyFrameObject* frame) if (dir == NULL) { return NULL; } - suggestions = calculate_suggestions(dir, name); + suggestions = _Py_CalculateSuggestions(dir, name); Py_DECREF(dir); return suggestions; @@ -371,7 +371,7 @@ offer_suggestions_for_import_error(PyImportErrorObject *exc) return NULL; } - PyObject *suggestion = calculate_suggestions(dir, name); + PyObject *suggestion = _Py_CalculateSuggestions(dir, name); Py_DECREF(dir); if (!suggestion) { return NULL; |
