Message338484
In term of API, we get something like:
_PyInitError err;
_PyPreConfig preconfig = _PyPreConfig_INIT;
preconfig.utf8_mode = 1;
preconfig.allocator = "malloc";
_PyInitError err = _Py_PreInitializeFromPreConfig(&preconfig);
if (_Py_INIT_FAILED(err)) {
_Py_ExitInitError(err);
}
/* PyMem_RawMalloc and Py_DecodeLocale can now be used */
_PyCoreConfig config = _PyCoreConfig_INIT;
config.user_site_directory = 0;
err = _Py_InitializeFromConfig(&config);
if (_Py_INIT_FAILED(err)) {
_Py_ExitInitError(err);
}
/* ... use Python ... */
Py_Finalize();
/* Note: no need to "free" preconfig nor config memory, they use constants */ |
|
Date |
User |
Action |
Args |
2019-03-20 15:32:41 | vstinner | set | recipients:
+ vstinner |
2019-03-20 15:32:41 | vstinner | set | messageid: <1553095961.34.0.427301322893.issue36301@roundup.psfhosted.org> |
2019-03-20 15:32:41 | vstinner | link | issue36301 messages |
2019-03-20 15:32:41 | vstinner | create | |
|