summaryrefslogtreecommitdiffstats
path: root/Lib/traceback.py
diff options
context:
space:
mode:
authorBatuhan Taskaya <isidentical@gmail.com>2022-10-31 13:27:13 (GMT)
committerGitHub <noreply@github.com>2022-10-31 13:27:13 (GMT)
commita41de32942b7ac14524587a08d219f3bfe346415 (patch)
tree4e2588b1dece4bcb370c9c2f5a13a872b77d5575 /Lib/traceback.py
parent39448adc9db0c0444443a42f13a9d7e1441b88e8 (diff)
downloadcpython-a41de32942b7ac14524587a08d219f3bfe346415.zip
cpython-a41de32942b7ac14524587a08d219f3bfe346415.tar.gz
cpython-a41de32942b7ac14524587a08d219f3bfe346415.tar.bz2
gh-98878: Use builtins from the bound frame when offering a suggestion (#98880)
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r--Lib/traceback.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py
index 0f0f2b3..cf5f355 100644
--- a/Lib/traceback.py
+++ b/Lib/traceback.py
@@ -1035,7 +1035,7 @@ def _compute_suggestion_error(exc_value, tb, wrong_name):
d = (
list(frame.f_locals)
+ list(frame.f_globals)
- + list(frame.f_globals['__builtins__'])
+ + list(frame.f_builtins)
)
if len(d) > _MAX_CANDIDATE_ITEMS:
return None