Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Lib/traceback.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import tokenize
import io
import _colorize
import dis

from contextlib import suppress

Expand Down Expand Up @@ -1677,8 +1678,9 @@ def _compute_suggestion_error(exc_value, tb, wrong_name):
d = (
list(frame.f_locals)
+ list(frame.f_globals)
+ list(frame.f_builtins)
)
if not dis.opname[frame.f_code.co_code[frame.f_lasti]].startswith('DELETE_'):
d += list(frame.f_builtins)
d = [x for x in d if isinstance(x, str)]

# Check first if we are in a method and the instance
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use a more simple way to forbidden the builtins name suggestion in deleting
Loading