mirror of
https://github.com/python/cpython.git
synced 2025-09-01 14:38:00 +00:00
bpo-36763: Add _PyInitError functions (GH-13395)
* Add _PyInitError functions: * _PyInitError_Ok() * _PyInitError_Error() * _PyInitError_NoMemory() * _PyInitError_Exit() * _PyInitError_IsError() * _PyInitError_IsExit() * _PyInitError_Failed() * frozenmain.c and _testembed.c now use functions rather than macros. * Move _Py_INIT_xxx() macros to the internal API. * Move _PyWstrList_INIT macro to the internal API.
This commit is contained in:
parent
12083284c5
commit
871ff77c1c
12 changed files with 102 additions and 59 deletions
|
@ -17,7 +17,7 @@ int
|
|||
Py_FrozenMain(int argc, char **argv)
|
||||
{
|
||||
_PyInitError err = _PyRuntime_Initialize();
|
||||
if (_Py_INIT_FAILED(err)) {
|
||||
if (_PyInitError_Failed(err)) {
|
||||
_Py_ExitInitError(err);
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ Py_FrozenMain(int argc, char **argv)
|
|||
err = _Py_InitializeFromConfig(&config);
|
||||
/* No need to call _PyCoreConfig_Clear() since we didn't allocate any
|
||||
memory: program_name is a constant string. */
|
||||
if (_Py_INIT_FAILED(err)) {
|
||||
if (_PyInitError_Failed(err)) {
|
||||
_Py_ExitInitError(err);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue