mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-98878: Use builtins from the bound frame when offering a suggestion (#98880)
This commit is contained in:
parent
39448adc9d
commit
a41de32942
3 changed files with 12 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue