Commit 2e8474d
committed
Issue #18408: slot_tp_str() must not fallback on slot_tp_repr() on error
type->tp_str must not point to slot_tp_str() if type has no __str__ attribute,
so there is no reason for slot_tp_str() to fallback on slot_tp_str() on lookup
error. Moreover, calling PyErr_Clear() may hide a real bug like MemoryError.
If __str__ attribute is removed, slots must be updated (which is done by
type_setattro()).1 parent 54e4ca7 commit 2e8474d
1 file changed
Lines changed: 2 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5274 | 5274 | | |
5275 | 5275 | | |
5276 | 5276 | | |
5277 | | - | |
| 5277 | + | |
| 5278 | + | |
5278 | 5279 | | |
5279 | 5280 | | |
5280 | 5281 | | |
5281 | 5282 | | |
5282 | | - | |
5283 | | - | |
5284 | | - | |
5285 | | - | |
5286 | | - | |
5287 | | - | |
5288 | | - | |
5289 | | - | |
5290 | | - | |
5291 | | - | |
5292 | | - | |
5293 | | - | |
5294 | | - | |
5295 | | - | |
5296 | | - | |
5297 | | - | |
5298 | | - | |
5299 | | - | |
5300 | 5283 | | |
5301 | 5284 | | |
5302 | 5285 | | |
| |||
0 commit comments