◐ Shell
clean mode source ↗

[3.12] gh-106030: Miscellaneous fixes in Python/suggestions.c (GH-106031) by miss-islington · Pull Request #106036 · python/cpython

@serhiy-storchaka @miss-islington

…H-106031)

* PyDict_GetItem() and PyObject_HasAttr() suppress arbitrary errors and
  should not be used.
* PyUnicode_CompareWithASCIIString() only works if the second argument
  is ASCII string.
* Refleak in get_suggestions_for_name_error.
* Use of borrowed pointer after possible freeing (self).
* Add some missing error checks.
(cherry picked from commit c8c162e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>