-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-38530: Offer suggestions on AttributeError #16856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c9c85b5
61d510b
dbd88f0
a3dd16a
c760303
71e8766
45061e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,12 @@ typedef struct { | |
PyObject *value; | ||
} PyStopIterationObject; | ||
|
||
typedef struct { | ||
PyException_HEAD | ||
PyObject *obj; | ||
PyObject *name; | ||
} PyAttributeErrorObject; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://www.python.org/dev/peps/pep-0473/ was rejected because it was too broad, but this PR adds a single exception, which sounds ok according to the resolution: https://mail.python.org/pipermail/python-dev/2019-March/156692.html My main worry is the risk of creating "more" and "worse" exception cycles, but Pablo says that it sounds unlikely: https://bugs.python.org/issue38530#msg354975 |
||
|
||
/* Compatibility typedefs */ | ||
typedef PyOSErrorObject PyEnvironmentErrorObject; | ||
#ifdef MS_WINDOWS | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
When printing :exc:`AttributeError`, :c:func:`PyErr_Display` will offer | ||
suggestions of simmilar attribute names in the object that the exception was | ||
raised from. Patch by Pablo Galindo |
Uh oh!
There was an error while loading. Please reload this page.