Dennis Sweeney <[email protected]> added the comment:
Even shorter reproducer:
-----------------------------
try:
aab
except BaseException as E:
E.with_traceback(None)
raise ZeroDivisionError()
-----------------------------
Bisection points to the initial implementation of suggestions.c:
5bf8bf2267cd109970b2d946d43b2e9f71379ba2 is the first bad commit
commit 5bf8bf2267cd109970b2d946d43b2e9f71379ba2
Author: Pablo Galindo <[email protected]>
Date: Wed Apr 14 15:10:33 2021 +0100
bpo-38530: Offer suggestions on NameError (GH-25397)
When printing NameError raised by the interpreter, PyErr_Display
will offer suggestions of simmilar variable names in the function that the
exception
was raised from:
>>> schwarzschild_black_hole = None
>>> schwarschild_black_hole
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'schwarschild_black_hole' is not defined. Did you mean:
schwarzschild_black_hole?
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue45826>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com