Commit f7e5b56
authored
* Don't use "Python runtime" anymore to parse command line options or
to get environment variables: pymain_init() is now a strict
separation.
* Use an error message rather than "crashing" directly with
Py_FatalError(). Limit the number of calls to Py_FatalError(). It
prepares the code to handle errors more nicely later.
* Warnings options (-W, PYTHONWARNINGS) and "XOptions" (-X) are now
only added to the sys module once Python core is properly
initialized.
* _PyMain is now the well identified owner of some important strings
like: warnings options, XOptions, and the "program name". The
program name string is now properly freed at exit.
pymain_free() is now responsible to free the "command" string.
* Rename most methods in Modules/main.c to use a "pymain_" prefix to
avoid conflits and ease debug.
* Replace _Py_CommandLineDetails_INIT with memset(0)
* Reorder a lot of code to fix the initialization ordering. For
example, initializing standard streams now comes before parsing
PYTHONWARNINGS.
* Py_Main() now handles errors when adding warnings options and
XOptions.
* Add _PyMem_GetDefaultRawAllocator() private function.
* Cleanup _PyMem_Initialize(): remove useless global constants: move
them into _PyMem_Initialize().
* Call _PyRuntime_Initialize() as soon as possible:
_PyRuntime_Initialize() now returns an error message on failure.
* Add _PyInitError structure and following macros:
* _Py_INIT_OK()
* _Py_INIT_ERR(msg)
* _Py_INIT_USER_ERR(msg): "user" error, don't abort() in that case
* _Py_INIT_FAILED(err)
1 parent 43605e6 commit f7e5b56
File tree
18 files changed
+1332
-643
lines changed- Include
- internal
- Modules
- Objects
- PCbuild
- Parser
- Programs
- Python
18 files changed
+1332
-643
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
77 | 79 | | |
78 | | - | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
23 | 48 | | |
24 | | - | |
| 49 | + | |
25 | 50 | | |
26 | | - | |
27 | | - | |
| 51 | + | |
| 52 | + | |
28 | 53 | | |
29 | 54 | | |
30 | 55 | | |
31 | 56 | | |
32 | 57 | | |
33 | 58 | | |
34 | | - | |
| 59 | + | |
| 60 | + | |
35 | 61 | | |
36 | 62 | | |
37 | 63 | | |
| |||
50 | 76 | | |
51 | 77 | | |
52 | 78 | | |
53 | | - | |
| 79 | + | |
54 | 80 | | |
55 | 81 | | |
56 | 82 | | |
| |||
86 | 112 | | |
87 | 113 | | |
88 | 114 | | |
89 | | - | |
| 115 | + | |
90 | 116 | | |
91 | | - | |
| 117 | + | |
92 | 118 | | |
93 | | - | |
| 119 | + | |
94 | 120 | | |
95 | 121 | | |
96 | 122 | | |
97 | | - | |
| 123 | + | |
98 | 124 | | |
99 | 125 | | |
100 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
226 | 230 | | |
227 | 231 | | |
228 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1281 | 1281 | | |
1282 | 1282 | | |
1283 | 1283 | | |
1284 | | - | |
1285 | | - | |
1286 | | - | |
1287 | 1284 | | |
1288 | | - | |
| 1285 | + | |
1289 | 1286 | | |
1290 | | - | |
1291 | | - | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
1292 | 1291 | | |
1293 | | - | |
1294 | | - | |
1295 | | - | |
1296 | | - | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
1297 | 1298 | | |
1298 | | - | |
1299 | | - | |
1300 | | - | |
| 1299 | + | |
| 1300 | + | |
1301 | 1301 | | |
1302 | | - | |
1303 | | - | |
1304 | | - | |
| 1302 | + | |
| 1303 | + | |
1305 | 1304 | | |
1306 | | - | |
1307 | | - | |
1308 | | - | |
1309 | | - | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
1310 | 1311 | | |
1311 | 1312 | | |
1312 | | - | |
1313 | | - | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
1314 | 1317 | | |
1315 | 1318 | | |
1316 | | - | |
1317 | | - | |
1318 | | - | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
1319 | 1322 | | |
1320 | | - | |
1321 | | - | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
1322 | 1328 | | |
1323 | 1329 | | |
1324 | | - | |
| 1330 | + | |
| 1331 | + | |
1325 | 1332 | | |
1326 | 1333 | | |
1327 | 1334 | | |
| |||
1345 | 1352 | | |
1346 | 1353 | | |
1347 | 1354 | | |
1348 | | - | |
1349 | | - | |
1350 | | - | |
| 1355 | + | |
1351 | 1356 | | |
1352 | 1357 | | |
1353 | 1358 | | |
1354 | 1359 | | |
1355 | | - | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
1356 | 1371 | | |
1357 | 1372 | | |
1358 | 1373 | | |
| |||
0 commit comments