Commit 515a5d3
[3.12] pythongh-126105: Fix crash in `ast` module, when `._fields` is deleted (pythonGH-126115)
Previously, if the `ast.AST._fields` attribute was deleted, attempts to create a new `as`t node would crash due to the assumption that `_fields` always had a non-NULL value. Now it has been fixed by adding an extra check to ensure that `_fields` does not have a NULL value (this can happen when you manually remove `_fields` attribute).
(cherry picked from commit b2eaa75)
Co-authored-by: sobolevn <[email protected]>
1 parent bce9df9 commit 515a5d3
File tree
4 files changed
+32
-12
lines changed- Lib/test/test_ast
- Misc/NEWS.d/next/Library
- Parser
- Python
4 files changed
+32
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
69 | 86 | | |
70 | 87 | | |
71 | 88 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
813 | 813 | | |
814 | 814 | | |
815 | 815 | | |
816 | | - | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
817 | 819 | | |
818 | 820 | | |
819 | | - | |
820 | | - | |
821 | | - | |
822 | | - | |
823 | | - | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
824 | 825 | | |
825 | 826 | | |
826 | 827 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments