◐ Shell
clean mode source ↗

gh-105035: fix super() calls on unusual types (e.g. meta-types) by carljm · Pull Request #105094 · python/cpython

@carljm

@bedevere-bot mentioned this pull request

May 30, 2023

@carljm

Fidget-Spinner

@carljm carljm marked this pull request as ready for review

May 30, 2023 16:18

@carljm

facebook-github-bot pushed a commit to facebookincubator/cinder that referenced this pull request

May 30, 2023
Summary:
This bug was discovered in the upstream `LOAD_SUPER_ATTR` implementation
in 3.12b1, and it also exists in the Cinder implementation.

`_PyObject_GetMethod` checks whether the type has a non-standard
`tp_getattro` (i.e. not `PyObject_GenericGetAttr`), and if so, refuses to attempt
the load-method optimization. We didn't have this check in the `super()`
optimization, causing incompatible behavior in the case of a `super()` lookup
on a type with unusual `tp_getattro`, e.g. meta-types.

Upstream fix is python/cpython#105094

Reviewed By: mpage

Differential Revision: D46281340

fbshipit-source-id: 41aba762d3e2925042a3d897a690317ba2767cf2

@carljm

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

May 30, 2023

carljm added a commit that referenced this pull request

May 30, 2023

@carljm carljm deleted the superbadgetattro branch

June 5, 2023 01:19