diff options
| author | Pablo Galindo <Pablogsal@gmail.com> | 2021-04-14 15:10:33 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-14 15:10:33 +0100 |
| commit | 5bf8bf2267cd109970b2d946d43b2e9f71379ba2 (patch) | |
| tree | a29b493cace0ba9cf1d5af516750ff9348ce6c49 /Include/cpython/pyerrors.h | |
| parent | c4073a24f95b54705416138dc1f20141ad76dd37 (diff) | |
| download | cpython-git-5bf8bf2267cd109970b2d946d43b2e9f71379ba2.tar.gz | |
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?
Diffstat (limited to 'Include/cpython/pyerrors.h')
| -rw-r--r-- | Include/cpython/pyerrors.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Include/cpython/pyerrors.h b/Include/cpython/pyerrors.h index a15082e693..9d88e6631f 100644 --- a/Include/cpython/pyerrors.h +++ b/Include/cpython/pyerrors.h @@ -64,6 +64,11 @@ typedef struct { typedef struct { PyException_HEAD + PyObject *name; +} PyNameErrorObject; + +typedef struct { + PyException_HEAD PyObject *obj; PyObject *name; } PyAttributeErrorObject; |
