summaryrefslogtreecommitdiffstats
path: root/Lib/traceback.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r--Lib/traceback.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py
index 1cf008c..30b42a4 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: