Commit f1796f2
Fix a race condition on setting a type __bases__ attribute: the
internal function add_subclass() now gets the
PyTypeObject.tp_subclasses member after calling PyWeakref_NewRef()
which can trigger a garbage collection which can indirectly modify
PyTypeObject.tp_subclasses.
(cherry picked from commit f1c6ae3)
Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
1 parent 6ed874f commit f1796f2
File tree
2 files changed
+21
-11
lines changed- Misc/NEWS.d/next/Core and Builtins
- Objects
2 files changed
+21
-11
lines changedLines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5622 | 5622 | | |
5623 | 5623 | | |
5624 | 5624 | | |
5625 | | - | |
5626 | | - | |
| 5625 | + | |
| 5626 | + | |
| 5627 | + | |
5627 | 5628 | | |
5628 | | - | |
| 5629 | + | |
| 5630 | + | |
| 5631 | + | |
| 5632 | + | |
| 5633 | + | |
| 5634 | + | |
| 5635 | + | |
| 5636 | + | |
| 5637 | + | |
| 5638 | + | |
5629 | 5639 | | |
5630 | 5640 | | |
5631 | 5641 | | |
5632 | 5642 | | |
5633 | 5643 | | |
5634 | 5644 | | |
5635 | | - | |
5636 | | - | |
5637 | | - | |
5638 | | - | |
5639 | | - | |
5640 | | - | |
5641 | | - | |
5642 | | - | |
| 5645 | + | |
| 5646 | + | |
| 5647 | + | |
5643 | 5648 | | |
5644 | 5649 | | |
5645 | 5650 | | |
| |||
0 commit comments