8000 Use "instead of" technique for clearer name suggestions · python/cpython@726189c · GitHub
[go: up one dir, main page]

Skip to content

Commit 726189c

Browse files
committed
Use "instead of" technique for clearer name suggestions
1 parent 9982147 commit 726189c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/traceback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ def __init__(self, exc_type, exc_value, exc_traceback, *, limit=None,
11291129
wrong_name = getattr(exc_value, "name", None)
11301130
suggestion = _compute_suggestion_error(exc_value, exc_traceback, wrong_name)
11311131
if suggestion:
1132-
self._str += f". Did you mean: '{suggestion}'?"
1132+
self._str += f". Did you mean '{suggestion}' instead of '{wrong_name}'?"
11331133
if issubclass(exc_type, NameError):
11341134
wrong_name = getattr(exc_value, "name", None)
11351135
if wrong_name is not None and wrong_name in sys.stdlib_module_names:

0 commit comments

Comments
 (0)
0