gh-110721: Remove unused code from suggestions.c after moving PyErr_Display to use the traceback module (#113712)

This commit is contained in:
Pablo Galindo Salgado 2024-01-08 15:10:45 +00:00 committed by GitHub
parent 802d4954f1
commit a03ec20bcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 117 additions and 225 deletions

View file

@ -1497,6 +1497,13 @@ def _compute_suggestion_error(exc_value, tb, wrong_name):
if hasattr(self, wrong_name):
return f"self.{wrong_name}"
try:
import _suggestions
except ImportError:
pass
else:
return _suggestions._generate_suggestions(d, wrong_name)
# Compute closest match
if len(d) > _MAX_CANDIDATE_ITEMS: