Commit 08285d5
authored
In the list of generated frozen modules at the top of Tools/scripts/freeze_modules.py, you will find that some of the modules have a different name than the module (or .py file) that is actually frozen. Let's call each case an "alias". Aliases do not come into play until we get to the (generated) list of modules in Python/frozen.c. (The tool for freezing modules, Programs/_freeze_module, is only concerned with the source file, not the module it will be used for.)
Knowledge of which frozen modules are aliases (and the identity of the original module) normally isn't important. However, this information is valuable when we go to set __file__ on frozen stdlib modules. This change updates Tools/scripts/freeze_modules.py to map aliases to the original module name (or None if not a stdlib module) in Python/frozen.c. We also add a helper function in Python/import.c to look up a frozen module's alias and add the result of that function to the frozen info returned from find_frozen().
https://bugs.python.org/issue45020
1 parent 4444291 commit 08285d5
File tree
10 files changed
+225
-37
lines changed- Include/internal
- Lib
- importlib
- test/test_importlib/frozen
- Misc/NEWS.d/next/Core and Builtins
- Programs
- Python
- clinic
- Tools/scripts
10 files changed
+225
-37
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
13 | 20 | | |
14 | 21 | | |
15 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
824 | 824 | | |
825 | 825 | | |
826 | 826 | | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
827 | 847 | | |
828 | 848 | | |
829 | 849 | | |
830 | 850 | | |
831 | 851 | | |
832 | | - | |
| 852 | + | |
833 | 853 | | |
834 | 854 | | |
835 | 855 | | |
836 | | - | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
837 | 860 | | |
838 | 861 | | |
839 | 862 | | |
| |||
857 | 880 | | |
858 | 881 | | |
859 | 882 | | |
860 | | - | |
| 883 | + | |
861 | 884 | | |
862 | 885 | | |
863 | 886 | | |
| |||
868 | 891 | | |
869 | 892 | | |
870 | 893 | | |
871 | | - | |
| 894 | + | |
872 | 895 | | |
873 | 896 | | |
874 | 897 | | |
| |||
1220 | 1243 | | |
1221 | 1244 | | |
1222 | 1245 | | |
| 1246 | + | |
| 1247 | + | |
1223 | 1248 | | |
1224 | 1249 | | |
1225 | 1250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
13 | 21 | | |
14 | 22 | | |
15 | 23 | | |
| |||
32 | 40 | | |
33 | 41 | | |
34 | 42 | | |
35 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
36 | 56 | | |
37 | 57 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | 58 | | |
43 | 59 | | |
44 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
45 | 67 | | |
46 | 68 | | |
47 | 69 | | |
| |||
58 | 80 | | |
59 | 81 | | |
60 | 82 | | |
61 | | - | |
| 83 | + | |
62 | 84 | | |
63 | 85 | | |
64 | 86 | | |
| |||
67 | 89 | | |
68 | 90 | | |
69 | 91 | | |
70 | | - | |
| 92 | + | |
71 | 93 | | |
72 | 94 | | |
73 | 95 | | |
74 | 96 | | |
75 | 97 | | |
76 | | - | |
| 98 | + | |
| 99 | + | |
77 | 100 | | |
78 | 101 | | |
79 | 102 | | |
80 | | - | |
| 103 | + | |
81 | 104 | | |
82 | 105 | | |
83 | 106 | | |
84 | 107 | | |
| 108 | + | |
85 | 109 | | |
86 | 110 | | |
87 | 111 | | |
88 | 112 | | |
89 | | - | |
| 113 | + | |
90 | 114 | | |
91 | 115 | | |
92 | 116 | | |
93 | 117 | | |
94 | 118 | | |
95 | 119 | | |
96 | 120 | | |
| 121 | + | |
97 | 122 | | |
98 | 123 | | |
99 | 124 | | |
100 | | - | |
| 125 | + | |
101 | 126 | | |
102 | 127 | | |
103 | 128 | | |
104 | 129 | | |
105 | 130 | | |
| 131 | + | |
106 | 132 | | |
107 | 133 | | |
108 | 134 | | |
109 | | - | |
| 135 | + | |
110 | 136 | | |
111 | 137 | | |
112 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
45 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
69 | | - | |
| 71 | + | |
| 72 | + | |
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
| |||
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
82 | | - | |
| 85 | + | |
| 86 | + | |
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
| |||
Lines 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 | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
| 33 | + | |
29 | 34 | | |
30 | 35 | | |
31 | 36 | | |
| |||
183 | 188 | | |
184 | 189 | | |
185 | 190 | | |
| 191 | + | |
186 | 192 | | |
187 | 193 | | |
188 | 194 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
105 | | - | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
108 | 124 | | |
109 | 125 | | |
110 | 126 | | |
| |||
0 commit comments