Repository navigation
Commit 141835b
Destructors can run after finalization has cleared the interpreter's
lazy_modules set and lazy_pending_submodules dict. Declaring or
resolving a lazy import from one of them passed NULL to PySet_Add(),
PySet_Discard() or the pending-submodules lookup.
Treat the bookkeeping as a no-op once the state is gone, as the other
readers of this state already do.
(cherry picked from commit a6e6361)
Co-authored-by: Brittany Reynoso <breynoso@meta.com>
1 parent cc3c98b commit 141835b
3 files changed
Lines changed: 69 additions & 3 deletions
File tree
- Lib/test/test_lazy_import
- Misc/NEWS.d/next/Core_and_Builtins
- Python
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2822 | 2822 | | |
2823 | 2823 | | |
2824 | 2824 | | |
| 2825 | + | |
| 2826 | + | |
| 2827 | + | |
| 2828 | + | |
| 2829 | + | |
| 2830 | + | |
| 2831 | + | |
| 2832 | + | |
| 2833 | + | |
| 2834 | + | |
| 2835 | + | |
| 2836 | + | |
| 2837 | + | |
| 2838 | + | |
| 2839 | + | |
| 2840 | + | |
| 2841 | + | |
| 2842 | + | |
| 2843 | + | |
| 2844 | + | |
| 2845 | + | |
| 2846 | + | |
| 2847 | + | |
| 2848 | + | |
| 2849 | + | |
| 2850 | + | |
| 2851 | + | |
| 2852 | + | |
| 2853 | + | |
| 2854 | + | |
| 2855 | + | |
| 2856 | + | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 2866 | + | |
| 2867 | + | |
| 2868 | + | |
| 2869 | + | |
| 2870 | + | |
| 2871 | + | |
| 2872 | + | |
| 2873 | + | |
| 2874 | + | |
| 2875 | + | |
| 2876 | + | |
| 2877 | + | |
| 2878 | + | |
| 2879 | + | |
2825 | 2880 | | |
2826 | 2881 | | |
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 | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
292 | 295 | | |
293 | 296 | | |
294 | 297 | | |
| |||
4176 | 4179 | | |
4177 | 4180 | | |
4178 | 4181 | | |
4179 | | - | |
| 4182 | + | |
| 4183 | + | |
| 4184 | + | |
| 4185 | + | |
4180 | 4186 | | |
4181 | 4187 | | |
4182 | 4188 | | |
| |||
4210 | 4216 | | |
4211 | 4217 | | |
4212 | 4218 | | |
4213 | | - | |
| 4219 | + | |
| 4220 | + | |
| 4221 | + | |
| 4222 | + | |
4214 | 4223 | | |
4215 | 4224 | | |
4216 | 4225 | | |
| |||
5572 | 5581 | | |
5573 | 5582 | | |
5574 | 5583 | | |
5575 | | - | |
| 5584 | + | |
5576 | 5585 | | |
5577 | 5586 | | |
5578 | 5587 | | |
| |||
0 commit comments