]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-38530: Offer suggestions on AttributeError (#16856)
authorPablo Galindo <Pablogsal@gmail.com>
Wed, 14 Apr 2021 01:36:07 +0000 (02:36 +0100)
committerGitHub <noreply@github.com>
Wed, 14 Apr 2021 01:36:07 +0000 (02:36 +0100)
commit37494b441aced0362d7edd2956ab3ea7801e60c8
tree45d9355cde5f7c71924e8df0f16ea2e0ad63eea8
parent3bc694d5f3d4eb2e5d2f0b83e498b19662845d4e
bpo-38530: Offer suggestions on AttributeError (#16856)

When printing AttributeError, PyErr_Display will offer suggestions of similar
attribute names in the object that the exception was raised from:

>>> collections.namedtoplo
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'collections' has no attribute 'namedtoplo'. Did you mean: namedtuple?
12 files changed:
Doc/library/exceptions.rst
Doc/whatsnew/3.10.rst
Include/cpython/pyerrors.h
Include/internal/pycore_pyerrors.h
Lib/test/test_exceptions.py
Makefile.pre.in
Misc/NEWS.d/next/Core and Builtins/2019-10-27-20-20-07.bpo-38530.ZyoDNn.rst [new file with mode: 0644]
Objects/exceptions.c
Objects/object.c
PCbuild/pythoncore.vcxproj
Python/pythonrun.c
Python/suggestions.c [new file with mode: 0644]