bpo-32030: Simplify _PyCoreConfig_INIT macro (#4728)

* Simplify _PyCoreConfig_INIT, _PyMainInterpreterConfig_INIT,
  _PyPathConfig_INIT macros: no need to set fields to 0/NULL, it's
  redundant (the C language sets them to 0/NULL for us).
* Fix typo: pymain_run_statup() => pymain_run_startup()
* Remove a few XXX/TODO
This commit is contained in:
Victor Stinner 2017-12-05 15:12:41 +01:00 committed by GitHub
parent ae342cf7de
commit 33c377ed9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 51 deletions

View file

@ -606,10 +606,6 @@ _Py_SetLocaleFromEnv(int category)
* safe to call without calling Py_Initialize first)
*/
/* TODO: Progressively move functionality from Py_BeginInitialization to
* Py_ReadConfig and Py_EndInitialization
*/
_PyInitError
_Py_InitializeCore(const _PyCoreConfig *config)
{
@ -881,10 +877,9 @@ _Py_InitializeMainInterpreter(const _PyMainInterpreterConfig *config)
return _Py_INIT_OK();
}
/* TODO: Report exceptions rather than fatal errors below here */
if (_PyTime_Init() < 0)
if (_PyTime_Init() < 0) {
return _Py_INIT_ERR("can't initialize time");
}
/* GetPath may initialize state that _PySys_EndInit locks
in, and so has to be called first. */