From 39f72456c98a79f5afb6783ade7ca31a8ed230d6 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Fri, 23 Jun 2023 15:03:04 +0100 Subject: [PATCH] gh-106025: Fix incorrect usage of PyUnicode_CompareWithASCIIString in suggestions.c --- .../2023-06-23-15-03-41.gh-issue-106025.Ij5Bnn.rst | 2 ++ Python/suggestions.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2023-06-23-15-03-41.gh-issue-106025.Ij5Bnn.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-06-23-15-03-41.gh-issue-106025.Ij5Bnn.rst b/Misc/NEWS.d/next/Core and Builtins/2023-06-23-15-03-41.gh-issue-106025.Ij5Bnn.rst new file mode 100644 index 00000000000000..caa0453db6948a --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2023-06-23-15-03-41.gh-issue-106025.Ij5Bnn.rst @@ -0,0 +1,2 @@ +Fix incorrect usage of :c:func:`PyUnicode_CompareWithASCIIString` in +``suggestions.c``. Patch by Pablo Galindo diff --git a/Python/suggestions.c b/Python/suggestions.c index f2c018ef2c4533..e67ccfa3621455 100644 --- a/Python/suggestions.c +++ b/Python/suggestions.c @@ -157,7 +157,7 @@ calculate_suggestions(PyObject *dir, PyMem_Free(buffer); return NULL; } - if (PyUnicode_CompareWithASCIIString(name, item_str) == 0) { + if (PyUnicode_Compare(name, item) == 0) { continue; } // No more than 1/3 of the involved characters should need changed.