diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2024-01-08 15:10:45 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-08 15:10:45 +0000 |
commit | a03ec20bcdf757138557127689405b3a525b3c44 (patch) | |
tree | f412c780e0fbf5fd0eaeb0aa48ad52953c461900 /Lib/traceback.py | |
parent | 802d4954f12541ba28dd7f18bf4a65054941a80d (diff) | |
download | cpython-a03ec20bcdf757138557127689405b3a525b3c44.tar.gz cpython-a03ec20bcdf757138557127689405b3a525b3c44.zip |
gh-110721: Remove unused code from suggestions.c after moving PyErr_Display to use the traceback module (#113712)
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r-- | Lib/traceback.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py index 1cf008c7e9d..30b42a4f693 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -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: |