Commit c638629
fix super() calls on unusual types (e.g. meta-types)
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: 41aba762d3e2925042a3d897a690317ba2767cf21 parent 11a85b3 commit c638629
2 files changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
320 | 329 | | |
321 | 330 | | |
322 | 331 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1724 | 1724 | | |
1725 | 1725 | | |
1726 | 1726 | | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
1727 | 1730 | | |
1728 | 1731 | | |
1729 | 1732 | | |
| |||
0 commit comments