Repository navigation
Commit 5e8536a
committed
gh-159283: Keep the propagating exception in PyObject_ClearManagedDict()
When an object whose __dict__ still pointed at its inline values was
freed while an exception was propagating, a failed allocation while
detaching the dict called PyErr_NoMemory(), which replaced that
exception, and PyErr_FormatUnraisable() then cleared it. A debug build
aborted in py_dealloc() and a release build went on with no exception
set, which ended in SystemError.
Save the current exception before detaching the dict and restore it
afterwards.1 parent 64018ac commit 5e8536a
3 files changed
Lines changed: 43 additions & 0 deletions
File tree
- Lib/test
- Misc/NEWS.d/next/Core_and_Builtins
- Objects
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1047 | 1047 | | |
1048 | 1048 | | |
1049 | 1049 | | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
1050 | 1085 | | |
1051 | 1086 | | |
1052 | 1087 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8018 | 8018 | | |
8019 | 8019 | | |
8020 | 8020 | | |
| 8021 | + | |
| 8022 | + | |
| 8023 | + | |
8021 | 8024 | | |
8022 | 8025 | | |
8023 | 8026 | | |
| |||
8038 | 8041 | | |
8039 | 8042 | | |
8040 | 8043 | | |
| 8044 | + | |
8041 | 8045 | | |
8042 | 8046 | | |
8043 | 8047 | | |
| |||
0 commit comments