Commit f1c6ae3
authored
bpo-46417: Fix race condition on setting type __bases__ (pythonGH-30788)
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.1 parent c8a5366 commit f1c6ae3
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 | |
|---|---|---|---|
| |||
6503 | 6503 | | |
6504 | 6504 | | |
6505 | 6505 | | |
6506 | | - | |
6507 | | - | |
| 6506 | + | |
| 6507 | + | |
| 6508 | + | |
6508 | 6509 | | |
6509 | | - | |
| 6510 | + | |
| 6511 | + | |
| 6512 | + | |
| 6513 | + | |
| 6514 | + | |
| 6515 | + | |
| 6516 | + | |
| 6517 | + | |
| 6518 | + | |
| 6519 | + | |
6510 | 6520 | | |
6511 | 6521 | | |
6512 | 6522 | | |
6513 | 6523 | | |
6514 | 6524 | | |
6515 | 6525 | | |
6516 | | - | |
6517 | | - | |
6518 | | - | |
6519 | | - | |
6520 | | - | |
6521 | | - | |
6522 | | - | |
6523 | | - | |
| 6526 | + | |
| 6527 | + | |
| 6528 | + | |
6524 | 6529 | | |
6525 | 6530 | | |
6526 | 6531 | | |
| |||
0 commit comments