]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-35992: Use PySequence_GetItem only if sq_item is not NULL (GH-11857)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 17 Feb 2019 23:33:04 +0000 (15:33 -0800)
committerGitHub <noreply@github.com>
Sun, 17 Feb 2019 23:33:04 +0000 (15:33 -0800)
commita7f929db605326da452fbdeebfe341afa9316d25
tree56b8fb61a61df34a2820591d9b04f88126df921f
parent6f352199e4447764bc472e34352d0dff4db8a52d
bpo-35992: Use PySequence_GetItem only if sq_item is not NULL (GH-11857)

Not using `__class_getitem__()` fallback if there is a non-subcriptable metaclass was caused by a certain asymmetry between how `PySequenceMethods` and `PyMappingMethods` are used in `PyObject_GetItem`. This PR removes this asymmetry. No tests failed, so I assume it was not intentional.
(cherry picked from commit ac28147e78c45a6217d348ce90ca5281d91f676f)

Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
Lib/test/test_genericclass.py
Misc/NEWS.d/next/Core and Builtins/2019-02-14-12-01-44.bpo-35992.nG9e2L.rst [new file with mode: 0644]
Objects/abstract.c