Commit af5a895
authored
_PyPathConfig_Init() now also initialize home and program_name:
* Rename existing _PyPathConfig_Init() to _PyPathConfig_Calculate().
Add a new _PyPathConfig_Init() function in pathconfig.c which
handles the _Py_path_config variable and call
_PyPathConfig_Calculate().
* Add home and program_name fields to _PyPathConfig.home
* _PyPathConfig_Init() now initialize home and program_name
from main_config
* Py_SetProgramName(), Py_SetPythonHome() and Py_GetPythonHome() now
calls Py_FatalError() on failure, instead of silently ignoring
failures.
* config_init_home() now gets directly _Py_path_config.home to only
get the value set by Py_SetPythonHome(), or NULL if
Py_SetPythonHome() was not called.
* config_get_program_name() now gets directly
_Py_path_config.program_name to only get the value set by
Py_SetProgramName(), or NULL if Py_SetProgramName() was not called.
* pymain_init_python() doesn't call Py_SetProgramName() anymore,
_PyPathConfig_Init() now always sets the program name
* Call _PyMainInterpreterConfig_Read() in
pymain_parse_cmdline_envvars_impl() to control the memory allocator
* C API documentation: it's no more safe to call Py_GetProgramName()
before Py_Initialize().
1 parent e23c06e commit af5a895
File tree
8 files changed
+180
-97
lines changed- Doc/c-api
- Include
- internal
- Modules
- PC
- Python
8 files changed
+180
-97
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
| |||
59 | 58 | | |
60 | 59 | | |
61 | 60 | | |
62 | | - | |
63 | | - | |
| 61 | + | |
| 62 | + | |
64 | 63 | | |
65 | 64 | | |
66 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
51 | 55 | | |
52 | 56 | | |
53 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
54 | 74 | | |
55 | 75 | | |
56 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
57 | 80 | | |
58 | 81 | | |
59 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1008 | 1008 | | |
1009 | 1009 | | |
1010 | 1010 | | |
1011 | | - | |
1012 | | - | |
1013 | 1011 | | |
1014 | | - | |
| 1012 | + | |
| 1013 | + | |
1015 | 1014 | | |
1016 | | - | |
1017 | | - | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
1021 | 1015 | | |
1022 | 1016 | | |
1023 | 1017 | | |
| |||
1026 | 1020 | | |
1027 | 1021 | | |
1028 | 1022 | | |
1029 | | - | |
1030 | | - | |
1031 | | - | |
1032 | | - | |
| 1023 | + | |
1033 | 1024 | | |
1034 | | - | |
1035 | 1025 | | |
1036 | 1026 | | |
1037 | 1027 | | |
1038 | | - | |
1039 | 1028 | | |
1040 | 1029 | | |
1041 | 1030 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
879 | 889 | | |
880 | 890 | | |
881 | 891 | | |
| |||
914 | 924 | | |
915 | 925 | | |
916 | 926 | | |
| 927 | + | |
917 | 928 | | |
918 | 929 | | |
919 | 930 | | |
| |||
948 | 959 | | |
949 | 960 | | |
950 | 961 | | |
951 | | - | |
952 | | - | |
953 | | - | |
954 | | - | |
955 | | - | |
956 | | - | |
957 | | - | |
958 | 962 | | |
959 | 963 | | |
960 | 964 | | |
| |||
1412 | 1416 | | |
1413 | 1417 | | |
1414 | 1418 | | |
1415 | | - | |
| 1419 | + | |
1416 | 1420 | | |
1417 | 1421 | | |
1418 | 1422 | | |
1419 | | - | |
| 1423 | + | |
| 1424 | + | |
1420 | 1425 | | |
1421 | | - | |
1422 | | - | |
1423 | 1426 | | |
1424 | 1427 | | |
1425 | 1428 | | |
| |||
1439 | 1442 | | |
1440 | 1443 | | |
1441 | 1444 | | |
1442 | | - | |
| 1445 | + | |
1443 | 1446 | | |
1444 | 1447 | | |
1445 | 1448 | | |
| |||
1543 | 1546 | | |
1544 | 1547 | | |
1545 | 1548 | | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
1546 | 1555 | | |
1547 | 1556 | | |
1548 | 1557 | | |
| |||
1566 | 1575 | | |
1567 | 1576 | | |
1568 | 1577 | | |
1569 | | - | |
1570 | | - | |
1571 | | - | |
1572 | | - | |
1573 | | - | |
1574 | 1578 | | |
1575 | 1579 | | |
1576 | 1580 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1058 | 1058 | | |
1059 | 1059 | | |
1060 | 1060 | | |
1061 | | - | |
1062 | | - | |
1063 | 1061 | | |
1064 | | - | |
| 1062 | + | |
| 1063 | + | |
1065 | 1064 | | |
1066 | | - | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
1070 | | - | |
1071 | | - | |
1072 | | - | |
1073 | 1065 | | |
1074 | 1066 | | |
1075 | 1067 | | |
1076 | 1068 | | |
1077 | 1069 | | |
1078 | | - | |
1079 | | - | |
1080 | | - | |
1081 | | - | |
| 1070 | + | |
1082 | 1071 | | |
1083 | 1072 | | |
1084 | 1073 | | |
1085 | 1074 | | |
1086 | | - | |
1087 | 1075 | | |
1088 | 1076 | | |
1089 | 1077 | | |
1090 | | - | |
1091 | | - | |
1092 | | - | |
1093 | 1078 | | |
1094 | 1079 | | |
1095 | 1080 | | |
| |||
0 commit comments