Commit 9ece9cd
authored
Enable recursion checks which were disabled when get __bases__ of
non-type objects in issubclass() and isinstance() and when intern
strings. It fixes a stack overflow when getting __bases__ leads
to infinite recursion.
Originally recursion checks was disabled for PyDict_GetItem() which
silences all errors including the one raised in case of detected
recursion and can return incorrect result. But now the code uses
PyDict_GetItemWithError() and PyDict_SetDefault() instead.
1 parent 619f980 commit 9ece9cd
File tree
4 files changed
+12
-4
lines changed- Lib/test
- Misc/NEWS.d/next/Core and Builtins
- Objects
4 files changed
+12
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
306 | 316 | | |
307 | 317 | | |
308 | 318 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2336 | 2336 | | |
2337 | 2337 | | |
2338 | 2338 | | |
2339 | | - | |
2340 | 2339 | | |
2341 | | - | |
2342 | 2340 | | |
2343 | 2341 | | |
2344 | 2342 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15734 | 15734 | | |
15735 | 15735 | | |
15736 | 15736 | | |
15737 | | - | |
15738 | 15737 | | |
15739 | | - | |
15740 | 15738 | | |
15741 | 15739 | | |
15742 | 15740 | | |
| |||
0 commit comments